Skip to content

Commit

Permalink
fix OnColumnChange to work with relationship based updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Axel 'fREW' Schmidt committed Nov 2, 2012
1 parent 2f973a6 commit f3a9244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Revision history for {{$dist->name}}

{{$NEXT}}
- fix OnColumnChange to work with relationship based updates
so $artist->update({ cd => $cd_obj }) now correctly triggers
a change. Thanks David Schmidt for the test
- validate number of arguments to _change_column (David Schmidt)
- fix name of Helper::ResultSet::Shortcut in SYNOPSIS

Expand Down
5 changes: 4 additions & 1 deletion lib/DBIx/Class/Helper/Row/OnColumnChange.pm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ sub after_column_change {
sub update {
my ($self, $args) = @_;

my %dirty = ( $self->get_dirty_columns, %{$args||{}} );
$self->set_inflated_columns($args) if $args;

my %dirty = $self->get_dirty_columns
or return $self;

my @all_before = @{$self->_before_change || []};
my @all_around = @{$self->_around_change || []};
Expand Down

0 comments on commit f3a9244

Please sign in to comment.