Class: Callbacks::ViewableBeforeUpdate
- Inherits:
-
Object
- Object
- Callbacks::ViewableBeforeUpdate
- Includes:
- Restrictor
- Defined in:
- app/models/callbacks/viewable_before_update.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'app/models/callbacks/viewable_before_update.rb', line 5 def call return unless m.has_unlocalized_fields? attributes = m.slice(*m.unlocalized_fields) m.other_locales.each do |viewable| viewable.update! attributes end end |