Skip to content
Browse files

Moved methods into the main body as only wiring is needed in append_f…

…eatures

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent df9276e commit 81e3d065776131636c1ee607f989b54952dac80c @dhh dhh committed
Showing with 7 additions and 9 deletions.
  1. +7 −9 activerecord/lib/active_record/mixins/touch.rb
View
16 activerecord/lib/active_record/mixins/touch.rb
@@ -20,17 +20,15 @@ def self.append_features(base)
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

0 comments on commit 81e3d06

Please sign in to comment.
Something went wrong with that request. Please try again.