Class: Page

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/page.rb

Defined Under Namespace

Classes: Translation

Instance Method Summary collapse

Instance Method Details

#translations_attributes=(attributes) ⇒ Object



24
25
26
27
28
29
# File 'app/models/page.rb', line 24

def translations_attributes=(attributes)
  new_translations = attributes.values.reduce({}) do |new_values, translation|
    new_values.merge! translation.delete("locale") => translation
  end
  set_translations new_translations
end