On Aug 11, 5:31 am, Polydectes <[email protected]> wrote:
> 1) WHY does db:schema:load run queries against my database when the
> data (and tables) aren't there?
>
> and
>
> 2) HOW do I fix this so it won't happen again?
rake db:schema:load requires the environment task (which loads your
app config and so on)
in production config.cache_classes is true, which means that your
applications models are loaded
your Mojo model is loaded, and reaches the line
named_scope :some_scope, :conditions => {.... self.new_state }
which runs your new_state ,method, which queries the database
One possible solution: alter your environment so that cache classes
doesn't get set to true in cases like this. I outlined a few ways of
doing this at
http://www.spacevatican.org/2008/12/28/when-cache_classes-gets-you-down
Fred
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---