Replace a call to changes with its code from AR::Dirty. #422
acts_as_journalized called changes as per ActiveRecord::Dirty (see http://ar.rubyonrails.org/classes/ActiveRecord/Dirty.html#M000291), the journalized model Changeset :has_many changes though, which made the call return a list of associated objects instead of the intended list of changed attributes. Replaced changes with the code from AR::Dirty to work around that.
This commit is contained in:
parent
6015913f34
commit
6f809b826e
|
@ -88,7 +88,7 @@ module Redmine::Acts::Journalized
|
|||
# creation. Incremental changes are reset when the record is saved because they represent
|
||||
# a subset of the dirty attribute changes, which are reset upon save.
|
||||
def incremental_journal_changes
|
||||
changes.slice(*journaled_columns)
|
||||
changed.inject({}) { |h, attr| h[attr] = attribute_change(attr); h }.slice(*journaled_columns)
|
||||
end
|
||||
|
||||
# Simply resets the cumulative changes after journal creation.
|
||||
|
|
Loading…
Reference in New Issue