diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-13 09:00:44 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2004-12-13 09:00:44 +0000 |
commit | 81e3d065776131636c1ee607f989b54952dac80c (patch) | |
tree | 0e0e1a1c9d46d41f5a2df0763085d4b20d4ffee6 | |
parent | df9276e8b9a64a08bd294361e8c56b50182d2663 (diff) | |
download | rails-81e3d065776131636c1ee607f989b54952dac80c.tar.gz rails-81e3d065776131636c1ee607f989b54952dac80c.tar.bz2 rails-81e3d065776131636c1ee607f989b54952dac80c.zip |
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
-rw-r--r-- | activerecord/lib/active_record/mixins/touch.rb | 16 |
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 |