[Rt-commit] r3838 - in Jifty-DBI/trunk: . inc/Module
inc/Module/Install lib/Jifty/DBI
jesse at bestpractical.com
jesse at bestpractical.com
Sun Sep 11 18:00:51 EDT 2005
Author: jesse
Date: Sun Sep 11 18:00:51 2005
New Revision: 3838
Modified:
Jifty-DBI/trunk/ (props changed)
Jifty-DBI/trunk/inc/Module/Install.pm
Jifty-DBI/trunk/inc/Module/Install/AutoInstall.pm
Jifty-DBI/trunk/inc/Module/Install/Base.pm
Jifty-DBI/trunk/inc/Module/Install/Makefile.pm
Jifty-DBI/trunk/inc/Module/Install/Metadata.pm
Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm
Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
Log:
r14125 at hualien: jesse | 2005-08-31 19:48:18 -0400
* Refactor class_accessible to use schema always
* Stub for schema
Modified: Jifty-DBI/trunk/inc/Module/Install.pm
==============================================================================
--- Jifty-DBI/trunk/inc/Module/Install.pm (original)
+++ Jifty-DBI/trunk/inc/Module/Install.pm Sun Sep 11 18:00:51 2005
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install.pm - /Library/Perl/5.8.6/Module/Install.pm"
+#line 1 "inc/Module/Install.pm - /usr/local/share/perl/5.8.4/Module/Install.pm"
package Module::Install;
$VERSION = '0.36';
Modified: Jifty-DBI/trunk/inc/Module/Install/AutoInstall.pm
==============================================================================
--- Jifty-DBI/trunk/inc/Module/Install/AutoInstall.pm (original)
+++ Jifty-DBI/trunk/inc/Module/Install/AutoInstall.pm Sun Sep 11 18:00:51 2005
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/AutoInstall.pm - /Library/Perl/5.8.6/Module/Install/AutoInstall.pm"
+#line 1 "inc/Module/Install/AutoInstall.pm - /usr/local/share/perl/5.8.4/Module/Install/AutoInstall.pm"
package Module::Install::AutoInstall;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
Modified: Jifty-DBI/trunk/inc/Module/Install/Base.pm
==============================================================================
--- Jifty-DBI/trunk/inc/Module/Install/Base.pm (original)
+++ Jifty-DBI/trunk/inc/Module/Install/Base.pm Sun Sep 11 18:00:51 2005
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Base.pm - /Library/Perl/5.8.6/Module/Install/Base.pm"
+#line 1 "inc/Module/Install/Base.pm - /usr/local/share/perl/5.8.4/Module/Install/Base.pm"
package Module::Install::Base;
#line 28
Modified: Jifty-DBI/trunk/inc/Module/Install/Makefile.pm
==============================================================================
--- Jifty-DBI/trunk/inc/Module/Install/Makefile.pm (original)
+++ Jifty-DBI/trunk/inc/Module/Install/Makefile.pm Sun Sep 11 18:00:51 2005
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Makefile.pm - /Library/Perl/5.8.6/Module/Install/Makefile.pm"
+#line 1 "inc/Module/Install/Makefile.pm - /usr/local/share/perl/5.8.4/Module/Install/Makefile.pm"
package Module::Install::Makefile;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
Modified: Jifty-DBI/trunk/inc/Module/Install/Metadata.pm
==============================================================================
--- Jifty-DBI/trunk/inc/Module/Install/Metadata.pm (original)
+++ Jifty-DBI/trunk/inc/Module/Install/Metadata.pm Sun Sep 11 18:00:51 2005
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Metadata.pm - /Library/Perl/5.8.6/Module/Install/Metadata.pm"
+#line 1 "inc/Module/Install/Metadata.pm - /usr/local/share/perl/5.8.4/Module/Install/Metadata.pm"
package Module::Install::Metadata;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Handle.pm Sun Sep 11 18:00:51 2005
@@ -474,7 +474,7 @@
}
else {
- warn "$self couldn't execute the query '$QueryString'";
+ Carp::cluck "$self couldn't execute the query '$QueryString'";
my $ret = Class::ReturnValue->new();
$ret->as_error(
Modified: Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm
==============================================================================
--- Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm (original)
+++ Jifty-DBI/trunk/lib/Jifty/DBI/Record.pm Sun Sep 11 18:00:51 2005
@@ -460,41 +460,16 @@
=head2 _class_accessible
-An older way to specify fields attributes in a derived class.
+An older way to read fields attributes in a derived class.
(The current preferred method is by overriding C<schema>; if you do
this and don't override C<_class_accessible>, the module will generate
an appropriate C<_class_accessible> based on your C<schema>.)
-Here's an example declaration:
-
- sub _class_accessible {
- {
- Tofu => { 'read'=>1, 'write'=>1 },
- Maz => { 'auto'=>1, },
- Roo => { 'read'=>1, 'auto'=>1, 'public'=>1, },
- };
- }
-
=cut
sub _class_accessible {
my $self = shift;
- return $self->_class_accessible_from_schema if $self->can('schema');
-
- # XXX This is stub code to deal with the old way we used to do _accessible
- # It should never be called by modern code
-
- my %accessible;
- while ( my $col = shift ) {
- $accessible{$col}->{ lc($_) } = 1 foreach split( /[\/,]/, shift );
- }
- return ( \%accessible );
-}
-
-sub _class_accessible_from_schema {
- my $self = shift;
-
my $accessible = {};
foreach my $key ( $self->_primary_keys ) {
$accessible->{$key} = { 'read' => 1 };
@@ -1232,6 +1207,18 @@
return ( $self->{'DBIxHandle'} );
}
+=head2 schema
+
+You must subclass schema to return your table's columns.
+
+XXX: See L<Jifty::DBI::SchemaGenerator> (I bet)
+
+=cut
+
+# This stub is here to prevent a call to AUTOLOAD
+sub schema {}
+
+
1;
__END__
More information about the Rt-commit
mailing list