Module: SneakySave
- Defined in:
- lib/sneaky-save.rb
Overview
– Copyright © 2011 PartyEarth LLC [email protected] ++
Instance Method Summary collapse
-
#sneaky_save ⇒ false, true
Saves the record without running callbacks/validations.
-
#sneaky_save! ⇒ true
Saves record without running callbacks/validations.
Instance Method Details
#sneaky_save ⇒ false, true
Note:
-
Does not reload updated record by default.
-
Does not save associated collections.
-
Saves only belongs_to relations.
Saves the record without running callbacks/validations. Returns true if the record is changed.
14 15 16 17 18 19 20 |
# File 'lib/sneaky-save.rb', line 14 def sneaky_save begin sneaky_create_or_update rescue ActiveRecord::StatementInvalid false end end |
#sneaky_save! ⇒ true
Saves record without running callbacks/validations.
26 27 28 |
# File 'lib/sneaky-save.rb', line 26 def sneaky_save! sneaky_create_or_update end |