Make sure array-relconds edge case is handled properly
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / ResultSource.pm
index 8c8f4cc..d8ec2b5 100644 (file)
@@ -211,6 +211,12 @@ The length of your column, if it is a column type that can have a size
 restriction. This is currently only used to create tables from your
 schema, see L<DBIx::Class::Schema/deploy>.
 
+   { size => [ 9, 6 ] }
+
+For decimal or float values you can specify an ArrayRef in order to
+control precision, assuming your database's
+L<SQL::Translator::Producer> supports it.
+
 =item is_nullable
 
    { is_nullable => 1 }
@@ -2121,7 +2127,13 @@ sub _resolve_relationship_condition {
 
   # we got something back - sanity check and infer values if we can
   my @nonvalues;
-  if ( my $jfc = $ret->{join_free_condition} and $ret->{join_free_condition} ne UNRESOLVABLE_CONDITION ) {
+  if (
+    $ret->{join_free_condition}
+      and
+    $ret->{join_free_condition} ne UNRESOLVABLE_CONDITION
+      and
+    my $jfc = $storage->_collapse_cond( $ret->{join_free_condition} )
+  ) {
 
     my $jfc_eqs = $storage->_extract_fixed_condition_columns($jfc, 'consider_nulls');
 
@@ -2306,7 +2318,7 @@ sub handle {
 
 my $global_phase_destroy;
 sub DESTROY {
-  ### NO detect_reinvoked_destructor check
+  ### NO detected_reinvoked_destructor check
   ### This code very much relies on being called multuple times
 
   return if $global_phase_destroy ||= in_global_destruction;