Fork me on GitHub

active_record

    Check the return value of "save", otherwise use "save!"

    02 Nov 2012

    Richard Huang (flyerhzm@gmail.com)

    The "save" method on ActiveRecord returns "false" and does nothing if the record is invalid. You should always check the return value, otherwise you may inadvertently not save the record. If you think the record can never be invalid, or don't want to check the return value, use "save!" Read More

    Tags