From 81e3d065776131636c1ee607f989b54952dac80c Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 13 Dec 2004 09:00:44 +0000 Subject: Moved methods into the main body as only wiring is needed in append_features git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/mixins/touch.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'activerecord/lib/active_record') 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 -- cgit v1.2.3