PriceSource: Bessere Behandlung von Boolean Werten
authorSven Schöling <s.schoeling@linet-services.de>
Mon, 12 Jan 2015 16:04:47 +0000 (17:04 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Mon, 12 Jan 2015 16:05:26 +0000 (17:05 +0100)
SL/Controller/PriceSource.pm
bin/mozilla/io.pl

index 9f8257c..df505a6 100644 (file)
@@ -97,6 +97,8 @@ sub _make_record_item {
       $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
     } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
       $obj->${\"$method\_as_number"}($::form->{"$method\_$row"});
+    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
+      $obj->$method(!!$::form->{$method});
     } else {
       $obj->$method($::form->{"$method\_$row"});
     }
@@ -147,6 +149,8 @@ sub _make_record {
       $obj->${\"$method\_as_date"}($::form->{$method});
     } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
       $obj->${\"$method\_as\_number"}($::form->{$method});
+    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
+      $obj->$method(!!$::form->{$method});
     } else {
       $obj->$method($::form->{$method});
     }
index f28c7b0..64eb764 100644 (file)
@@ -1958,6 +1958,8 @@ sub _make_record_item {
       $obj->${\"$method\_as_date"}($::form->{"$method\_$row"});
     } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
       $obj->${\"$method\_as_number"}($::form->{"$method\_$row"});
+    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
+      $obj->$method(!!$::form->{$method});
     } else {
       $obj->$method($::form->{"$method\_$row"});
     }
@@ -2004,6 +2006,8 @@ sub _make_record {
       $obj->${\"$method\_as_date"}($::form->{$method});
     } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::(?:Numeric|Float|DoublePrecsion)$/) {
       $obj->${\"$method\_as_number"}($::form->{$method});
+    } elsif ((ref $obj->meta->column($method)) =~ /^Rose::DB::Object::Metadata::Column::Boolean$/) {
+      $obj->$method(!!$::form->{$method});
     } else {
       $obj->$method($::form->{$method});
     }