Factor out the limit implementations into a separate file
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / FilterColumn.pm
index 9002058..3c3f04f 100644 (file)
@@ -123,7 +123,11 @@ sub update {
       exists $self->column_info($key)->{_filter_info}
     ) {
       $self->set_filtered_column($key, delete $attrs->{$key});
-      $self->get_column($key);
+
+      # FIXME update() reaches directly into the object-hash
+      # and we may *not* have a filtered value there - thus
+      # the void-ctx filter-trigger
+      $self->get_column($key) unless exists $self->{_column_data}{$key};
     }
   }
 
@@ -154,7 +158,12 @@ DBIx::Class::FilterColumn - Automatically convert column data
 
 =head1 SYNOPSIS
 
- # In your result classes
+In your Schema or DB class add "FilterColumn" to the top of the component list.
+
+  __PACKAGE__->load_components(qw( FilterColumn ... ));
+
+Set up filters for the columns you want to convert.
+
  __PACKAGE__->filter_column( money => {
      filter_to_storage => 'to_pennies',
      filter_from_storage => 'from_pennies',
@@ -166,6 +175,7 @@ DBIx::Class::FilterColumn - Automatically convert column data
 
  1;
 
+
 =head1 DESCRIPTION
 
 This component is meant to be a more powerful, but less DWIM-y,