[Rt-commit] r3485 - in DBIx-SearchBuilder/trunk: . SearchBuilder
jesse at bestpractical.com
jesse at bestpractical.com
Sat Jul 16 19:30:10 EDT 2005
Author: jesse
Date: Sat Jul 16 19:30:10 2005
New Revision: 3485
Modified:
DBIx-SearchBuilder/trunk/ (props changed)
DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm
Log:
r4863 at hualien: jesse | 2005-07-16 19:29:10 -0400
make _ClassAccessibleFromSchema respect _PrimaryKeys
Modified: DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm
==============================================================================
--- DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm (original)
+++ DBIx-SearchBuilder/trunk/SearchBuilder/Record.pm Sat Jul 16 19:30:10 2005
@@ -581,9 +581,9 @@
sub _ClassAccessibleFromSchema {
my $self = shift;
- my $accessible = {
- # XXX TODO FIXME: should fetch custom primary key name
- 'id' => { 'read' => 1 },
+ my $accessible = {};
+ foreach my $key ($self->_PrimaryKeys) {
+ $accessible->{$key} = { 'read' => 1 };
};
my $schema = $self->Schema;
@@ -677,9 +677,8 @@
sub WritableAttributes {
my $self = shift;
my $ca = $self->_ClassAccessible();
- my @writable = grep { $ca->{$_}->{'write'} or $ca->{$_}->{'record-write'} } keys %{$ca};
- return (@writable);
-
+ my @writable = grep { $ca->{$_}->{'write'} || $ca->{$_}->{'record-write'} } keys %{$ca};
+ return @writable;
}
More information about the Rt-commit
mailing list