Class: Callbacks::ViewableBeforeUpdate

Inherits:
Object
  • Object
show all
Includes:
Restrictor
Defined in:
app/models/callbacks/viewable_before_update.rb

Instance Method Summary collapse

Instance Method Details

#callObject



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