0.04001
- Fix so set_inflated_column calls set_column
+ - Allow syntax errors in relationship classes to be reported.
0.04 2005-11-26
- Moved get_simple and set_simple into AccessorGroup
die "Can't create relationship without join condition" unless $cond;
$attrs ||= {};
eval "require $f_class;";
+ if ($@) {
+ $class->throw($@) unless $@ =~ /Can't locate/;
+ }
my %rels = %{ $class->_relationships };
$rels{$rel} = { class => $f_class,
cond => $cond,
sub belongs_to {
my ($class, $rel, $f_class, $cond, $attrs) = @_;
eval "require $f_class";
+ if ($@) {
+ $class->throw($@) unless $@ =~ /Can't locate/;
+ }
+
my %f_primaries;
$f_primaries{$_} = 1 for eval { $f_class->primary_columns };
my $f_loaded = !$@;
my ($class, $rel, $f_class, $cond, $attrs) = @_;
eval "require $f_class";
+ if ($@) {
+ $class->throw($@) unless $@ =~ /Can't locate/;
+ }
unless (ref $cond) {
my ($pri, $too_many) = $class->primary_columns;
sub _has_one {
my ($class, $join_type, $rel, $f_class, $cond, $attrs) = @_;
eval "require $f_class";
+ if ($@) {
+ $class->throw($@) unless $@ =~ /Can't locate/;
+ }
+
unless (ref $cond) {
my ($pri, $too_many) = $class->primary_columns;
$class->throw( "might_have/has_one can only infer join for a single primary key; ${class} has more" )