Em 27-04-2012 16:17, Jeremy Kemper escreveu:
On Fri, Apr 27, 2012 at 9:56 AM, Rodrigo Rosenfeld Rosas <[email protected] <mailto:[email protected]>> wrote:

    This only handles the default database as noticed by Jeremy. If
    you have models relying on different databases, only the default
    one will be sandboxed.


This is intentional. It's a simple convenience for working with a typical db. Note that it doesn't sandbox your redis, memcached, or the filesystem, either.

    Any thoughts about this?


All good points. But this is all --sandbox was meant to do. We don't really want to build a general-purpose sandbox that any rollback-able data store can participate in.

Then I guess it would be safer to document this as well when mentioning the sandbox param in the official guides:

http://guides.rubyonrails.org/command_line.html#rails-console

Also, I tried to get a similar result with Sequel but Rails.application.sandbox? is nil when run inside an initializer file.

I also tried Rails.application.config.after_initialize, but it is still nil. How can I know if the "--sandbox" parameter was present from the initializer where I set up Sequel?

Thanks in advance,
Rodrigo.

--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Core" 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-core?hl=en.

Reply via email to