Permalink
Browse files

Fix for previous commit to only set updater if record changed to ensu…

…re that updater is set for a new record
  • Loading branch information...
chrismhilton committed Apr 30, 2012
1 parent a0eca01 commit f5605e16f09f33d88d9de629ac597e13b6f9df08
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/stampable.rb
View
@@ -133,9 +133,9 @@ def set_creator_attribute
def set_updater_attribute
return unless self.record_userstamp
- # only set updater if the record has changed
+ # only set updater if the record is new or has changed
# or contains a serialized attribute (in which case the attribute value is always updated)
- return unless self.changed? || self.serialized_attributes.present?
+ return unless self.new_record? || self.changed? || self.serialized_attributes.present?
if respond_to?(self.updater_attribute.to_sym) && has_stamper?
self.send("#{self.updater_attribute}=".to_sym, self.class.stamper_class.stamper)
end

0 comments on commit f5605e1

Please sign in to comment.