Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Foo < ActiveRecord::Base
- # assume Foo has an attribute called "title"
- before_save :my_callback
- def my_callback
- self.title = "Prefix: #{self.title}" # this doesn't work if you remove "self" - why?
- end
- end
Add Comment
Please, Sign In to add comment