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 false , create and update just return the objects.
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did43661