Dynamic database switching

I’ve developped a rails app and am trying to improve the training mode
i’ve
started to develop for it (its an inward facing rails app BTW). Anyway
at
the moment i have it set up so while in training mode it flags any
orders
created as ‘training’ using a bitwise op. While changes to orders aren’t
‘real’ in training mode changes to the other tables do in fact take
effect.
what i want to do to improve the training mode is to make another
database
that mirrors all the tables used by the app and have the models
dynamically
switch to the training database when training mode is turned on. Anyway
to
do this other than create a whole new set of models and have an if
statement
determine which to call before any model is called on??

thanks in advance

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs