Module: Memorable::Model

Extended by:
ActiveSupport::Concern
Defined in:
lib/memorable/model.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#write_content(options) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/memorable/model.rb', line 6

def write_content(options)
  current_locale = I18n.locale

  Memorable.config.template_engine.assemble(options).each do |template|
    I18n.locale  = template[0]
    self.content = template[1]
  end

  I18n.locale = current_locale
end