Wednesday, September 17, 2008

Active Record new_record? method

Want to know an instant of Active Record is a just created or loaded from database?

model_instant.new_record? # => true: just created
model_instant.new_record? # => false: created sometime ago

I use this method quite often but can't remember the name so I write a post about it with the hope that the method name will be burned in my brain :D

No comments: