Skip to content

Commit

Permalink
Moved methods into the main body as only wiring is needed in append_f…
Browse files Browse the repository at this point in the history
…eatures

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@140 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Dec 13, 2004
1 parent df9276e commit 81e3d06
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions activerecord/lib/active_record/mixins/touch.rb
Expand Up @@ -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.