Sha256: 52dcbf7e342416637f77aa0d49ba11d5f259beb34b72768c56afc0ea9990880b

Contents?: true

Size: 286 Bytes

Versions: 9

Compression:

Stored size: 286 Bytes

Contents

module Callbacks
  class ViewableBeforeUpdate
    include Restrictor

    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
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_admin_cms-0.1.1 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.9 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.7 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.6 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.5 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.4 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.3 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.2 app/models/callbacks/viewable_before_update.rb
rails_admin_cms-0.0.1 app/models/callbacks/viewable_before_update.rb