I am creating a gem for a Rails project and I got some troubles to understand how generators and initializers work. I would like to initialize my module loading some stuff from the database from models related to tables my gem should create with a migration file. Problem is : if I create a Railtie and put it my gem lib directory, when I try to run my generator (to create the migration template file for example), it's already trying to run the Railtie even though tables required don't exist yet.
How to restrict the "scope" of the Railtie ? I would like it only to run when booting Rails from a server (webrick, thin, ...) or from the console, but not for any rake tasks (including generators). I think that rake tasks (like generators) load the entire Rails environment and my problem should come from that. Is there a simpler way to do that ? any help or advice appreciated. Florent -- 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.

