rails 笔记

The following methods trigger validations, and will save the object to the database only if the object is valid:

  • create
  • create!
  • save
  • save!
  • update
  • update_attributes
  • update_attributes!

The bang versions (e.g. save!) raise an exception if the record is invalid. The non-bang versions don’t: save and update_attributes return falsecreate and update just return the objects.

原文地址:https://www.cnblogs.com/lexus/p/1871447.html