Forum: Ruby on Rails rake without code evaluation?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9d79da034ee21c2aa1304e3c02e993eb?d=identicon&s=25 Danny (Guest)
on 2007-05-11 11:25
Hey people,

Here's a problem I have. I have a table inside my database which
contains ruby/rails code snippets. When I use rake db:fixtures:load and
it starts to import my snippets table it starts evaluating the code
snippets inside the table which breaks the rake operation.

Is there a sollution to this problem?

Thanks very much in advance,

Danny
C9c7a65848f13e2b1a226bbe43bc3672?d=identicon&s=25 Pete Yandell (pete)
on 2007-05-14 01:47
(Received via mailing list)
On 11/05/2007, at 7:25 PM, Danny wrote:

> Here's a problem I have. I have a table inside my database which
> contains ruby/rails code snippets. When I use rake db:fixtures:load
> and
> it starts to import my snippets table it starts evaluating the code
> snippets inside the table which breaks the rake operation.

Huh? Code in fields in the database will never get run unless you've
written something to run it!

Can you show some of your code and give some example data?

Pete Yandell
http://notahat.com/
0ab6a5abab167b409f58d280dc59a229?d=identicon&s=25 Faisal N Jawdat (Guest)
on 2007-05-14 02:31
(Received via mailing list)
On 11/05/2007, at 7:25 PM, Danny wrote:
> Here's a problem I have. I have a table inside my database which
> contains ruby/rails code snippets. When I use rake db:fixtures:load
> and it starts to import my snippets table it starts evaluating the
> code snippets inside the table which breaks the rake operation.

fixtures files are yaml files which can contain ruby code.  this lets
you do things like have a database.yml with conditional configuration
based on the user, etc.  as a guess (i haven't worked with this), the
problem lies there, and you'll need to come up with a way to
appropriately escape the code.

-faisal
This topic is locked and can not be replied to.