In Ruby on Rails, for an ActiveRecord class MySettings, is there a more elegant option to say
s = MySettings.last
s.do_updates = true
s.save
in one line?
Use update_attributes:
MySettings.last.update_attributes :do_updates => true
update_attributes
MySettings.last.update_attributes(:do_updates => true)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With