Module: LazyAttributes
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/lazy_attributes.rb,
lib/lazy_attributes/version.rb
Defined Under Namespace
Modules: ClassMethods
Constant Summary collapse
- VERSION =
'0.0.1'
Instance Method Summary collapse
Instance Method Details
#reload_but_keep_changes ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/lazy_attributes.rb', line 11 def reload_but_keep_changes return unless persisted? changes_before_reload = changes.clone reload changes_before_reload.each do |attr_name, values| send("#{attr_name}=", values[1]) end end |