If you take the cache_classes out of your production mode while you
migrate it'll work fine.

That's the workaround for this issue.

On Jan 7, 12:57 pm, Tys von Gaza <[email protected]> wrote:
> This is a known bug in rails 2.2, in lighthouse it is tagged for the
> 2.3 milestone which will hopeful arrive in the next couple of weeks.
> The lighthouse issue has some work arounds:
>
> http://rails.lighthouseapp.com/projects/8994/tickets/802-eager-load-a...
>
> Tys
>
> On Jan 7, 10:20 am, Neil <[email protected]> wrote:
>
> > Hello all.
>
> > Preamble: I'm using Rails 2.2.2, and the latest ActiveScaffold from
> > github as of the time of writing.
>
> > My scenario is this:
>
> > * I create a new app, and install ActiveScaffold
> > * I create a model, say "Widget", and the migration to create it
> > * I create a controller that has "active_scaffold :widgets" in it (and
> > nothing else)
>
> >     -- the simplest possible ActiveScaffold use case, I'd have
> > thought.
>
> > In development mode, I can now rake db:migrate and everything works as
> > expected.
>
> > HOWEVER! In production mode, I cannot migrate; the widgets controller
> > throws an error on the ActiveScaffold line, saying "Could not find
> > table 'clients'".
>
> > As far as I can tell, it's because in production mode, the controllers
> > get cached up-front, which causes ActiveScaffold to initialize, which
> > causes the Widget model to load, which fails because the table doesn't
> > exist.
>
> > ---
>
> > Does this strike anyone else as odd? Is this a change either in recent
> > Rails or ActiveScaffold versions? (I haven't yet tested to see). I've
> > used Rails and ActiveScaffold in previous versions, as I swear this
> > issue would have bitten me before if it had always been like this -
> > but perhaps I'm wrong.
>
> > Is everyone else used to deploying just a migration to the production
> > server, migrating it, and only then deploying code that uses
> > ActiveScaffold to refer to it?
>
> > If anyone has any thoughts or light to shed on this, it would be
> > greatly appreciated.
>
> > Many thanks,
> > Neil.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" 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/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to