ActiveRecord: has the object been saved to the database yet?
Cleaner than checking if the value of fruit.id is nil:
fruit.new_record?
Cleaner than checking if the value of fruit.id is nil:
fruit.new_record?