nonexisting prefetch
- Fixed the prefetch with limit bug
- New resultsed method count_rs, returns a ::ResultSetColumn
- returning a single count value
+ which in turn returns a single count value
+ - make_column_dirty() now overwrites the deflated value with an
+ inflated one if such exists
0.08107 2009-06-14 08:21:00 (UTC)
- Fix serialization regression introduced in 0.08103 (affects
$self->throw_exception( "No such column '${column}'" )
unless exists $self->{_column_data}{$column} || $self->has_column($column);
+
+ # the entire clean/dirty code relieas on exists, not on true/false
+ return 1 if exists $self->{_dirty_columns}{$column};
+
$self->{_dirty_columns}{$column} = 1;
+
+ # if we are just now making the column dirty, and if there is an inflated
+ # value, force it over the deflated one
+ if (exists $self->{_inflated_column}{$column}) {
+ $self->store_column($column,
+ $self->_deflated_column(
+ $column, $self->{_inflated_column}{$column}
+ )
+ );
+ }
}
=head2 get_inflated_columns
plan (skip_all => "No suitable serializer found") unless $selected;
-plan (tests => 8);
+plan (tests => 11);
DBICTest::Schema::Serialized->inflate_column( 'serialized',
{ inflate => $selected->{inflater},
deflate => $selected->{deflater},
ok($object->update( { serialized => $struct_array } ), 'arrayref deflation');
ok($inflated = $object->serialized, 'arrayref inflation');
is_deeply($inflated, $struct_array, 'inflated array matches original');
+
+
+#===== make sure make_column_dirty ineracts reasonably with inflation
+$object = $rs->first;
+$object->update ({serialized => { x => 'y'}});
+
+$object->serialized->{x} = 'z'; # change state without notifying $object
+ok (!$object->get_dirty_columns, 'no dirty columns yet');
+is_deeply ($object->serialized, { x => 'z' }, 'object data correct');
+
+$object->make_column_dirty('serialized');
+$object->update;
+
+is_deeply ($rs->first->serialized, { x => 'z' }, 'changes made it to the db' );