Permalink
Browse files

ActiveModel::Callbacks basic guide

  • Loading branch information...
1 parent 33d7a6b commit d5adaf2d38f81429e21d9670b6a852668edb3757 @vatrai vatrai committed with fxn Aug 5, 2011
Showing with 2 additions and 6 deletions.
  1. +2 −6 railties/guides/source/active_model_basics.textile
View
8 railties/guides/source/active_model_basics.textile
@@ -57,18 +57,14 @@ class Person
def update
_run_update_callbacks do
- puts 'saving...'
+ # This will call when we are trying to call update on object.
end
end
def reset_me
- puts 'before saving...'
+ # This method will call when you are calling update on object as a before_update callback as defined.
end
end
-
-person = Person.new
-person.update # before saving...
- # saving...
</ruby>
h3. Changelog

0 comments on commit d5adaf2

Please sign in to comment.