aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/mixins/touch.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/mixins/touch.rb')
-rw-r--r--activerecord/lib/active_record/mixins/touch.rb16
1 files changed, 7 insertions, 9 deletions
diff --git a/activerecord/lib/active_record/mixins/touch.rb b/activerecord/lib/active_record/mixins/touch.rb
index eef041650b..baf217542a 100644
--- a/activerecord/lib/active_record/mixins/touch.rb
+++ b/activerecord/lib/active_record/mixins/touch.rb
@@ -20,17 +20,15 @@ module ActiveRecord
base.before_create :touch_on_create
base.before_update :touch_on_update
+ end
- base.class_eval do
- def touch_on_create
- self.updated_at = (self.created_at ||= Time.now)
- end
+ def touch_on_create
+ self.updated_at = (self.created_at ||= Time.now)
+ end
- def touch_on_update
- self.updated_at = Time.now
- end
- end
- end
+ def touch_on_update
+ self.updated_at = Time.now
+ end
end
end
end \ No newline at end of file