Hello,
I have a model called Contents, and every content belongs to a Role.
The Roles are suposed to be constants (they are always the same and
don't change), so I decided to create a migrate to insert the data in
the db. The point was that every role has more properties, like
priority, and I found it was not a good idea to create a simple class
with normal constants. Furthermore, I added a method (const_missing)
in the model Role so when I search a constant it checks the db table
and creates it dinamically.

My problem appeared when I was writing the tests because the migrates
don't get executed, and so I don't have any role in my test db. And
they are suposed to be constants and be always there.

In another project we used fixtures to fix this problem but I don't
think that it's the best way because you must keep synch the db and
the fixtures. Quite ugly.

Thanks in advance for your answers.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to