Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

db:fixtures:dump does not escape <%

#428

I have a model EmailTemplate and its email_templates db table:

create_table :email_templates do |t|

t.string :name, :limit => 100

t.text :headers, :null => true

t.text :body

end

These templates basically hold views for ActionMailer (within the db instead of file because of editing via admin panel). So I use the Ruby code inside the body, like:

Your e-mail is: <%= @user.email %>

When I dump the model (rake db:fixtures:dump MODEL=EmailTemplate), the code goes into the YML file without escaping:

template_00002:

name: xxxx

body: "Your e-mail is: <%= @user.email %>,\r\n\

(...)

This way the code gets executed while loading fixture (rake db:fixtures:load FIXTURE=templates) instead of ActionMailer... The YML file should hold the data escaped:

body: "Your e-mail is: <%%= @user.email %>,\r\n\

Reported by Nataniel · June 16th, 2008 @ 10:58 AM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Chris Lloyd
    Chris Lloyd
    • Tag set to fixtures

    I could be mistaken but I don't believe there is a db:fixtures:dump task in Rails at the moment.

    August 7th, 2008 @ 02:19 AM

  2. Nataniel
    Nataniel

    Chris, you're absolutely right. My bad, I thought it is core Rails task, but it came into my project from arfixtures plugin: http://topfunky.net/svn/plugins/arfixtures. Please close the ticket as bogus.

    August 7th, 2008 @ 06:26 AM

  3. josh
    josh
    • State changed from new to invalid

    August 7th, 2008 @ 06:39 AM