Sha256: 2208b4690b9018c7481eff07cede63cc2ac63d24c11ed009cdf0e0973b8e2764

Contents?: true

Size: 399 Bytes

Versions: 25

Compression:

Stored size: 399 Bytes

Contents

def update_message_template
  YAML.load(open('db/fixtures/enju_message/message_templates.yml').read).each do |line|
    l = line[1].select!{|k, v| %w(status locale title body).include?(k)}
    template = MessageTemplate.where(
      status: l["status"], locale: l["locale"]
    ).first
    if template
      template.update_attributes!(l)
    else
      MessageTemplate.create!(l)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
enju_message-0.2.4 lib/tasks/message_template.rb
enju_message-0.2.3 lib/tasks/message_template.rb
enju_message-0.2.2 lib/tasks/message_template.rb
enju_message-0.2.1 lib/tasks/message_template.rb
enju_message-0.2.0 lib/tasks/message_template.rb
enju_message-0.2.0.beta.5 lib/tasks/message_template.rb
enju_message-0.2.0.beta.4 lib/tasks/message_template.rb
enju_message-0.2.0.beta.3 lib/tasks/message_template.rb
enju_message-0.2.0.beta.2 lib/tasks/message_template.rb
enju_message-0.2.0.beta.1 lib/tasks/message_template.rb
enju_message-0.1.16 lib/tasks/message_template.rb
enju_message-0.1.15 lib/tasks/message_template.rb
enju_message-0.1.14 lib/tasks/message_template.rb
enju_message-0.1.14.pre26 lib/tasks/message_template.rb
enju_message-0.1.14.pre25 lib/tasks/message_template.rb
enju_message-0.1.14.pre24 lib/tasks/message_template.rb
enju_message-0.1.14.pre23 lib/tasks/message_template.rb
enju_message-0.1.14.pre22 lib/tasks/message_template.rb
enju_message-0.1.14.pre21 lib/tasks/message_template.rb
enju_message-0.1.14.pre20 lib/tasks/message_template.rb