diff options
author | eileencodes <eileencodes@gmail.com> | 2019-04-18 14:06:37 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2019-04-18 14:06:37 -0400 |
commit | 456c3f10563402cab1f4a2f4e541bd3d053a5caf (patch) | |
tree | 572297d51c2340be00db3bca8ecc7f71637b798c /activerecord/lib/active_record/validations/associated.rb | |
parent | 0f39a7488ed736a76cc6cee166fba01d1e3c5686 (diff) | |
download | rails-456c3f10563402cab1f4a2f4e541bd3d053a5caf.tar.gz rails-456c3f10563402cab1f4a2f4e541bd3d053a5caf.tar.bz2 rails-456c3f10563402cab1f4a2f4e541bd3d053a5caf.zip |
Ensure active record can load without Railties
When I added the rake tasks for multiple databases I accidentally made
it so you couldn't use Active Record without Railties.
Since getting the database configuration depends on being able to load
Railties (there is no other way to read and parse the yaml file and load
it) I've decided that using multiple databases outside of Rails is a
no-op.
I've changed the code here to return if Rails isn't defined. Then I
changed the other tasks to use `ActiveRecord::Tasks::DatabaseTasks.env`
instead of `Rails.env`. The multi-db tasks can keep using `Rails.env`
because they'll only be generated if we're using Rails and not just
Active Record.
Diffstat (limited to 'activerecord/lib/active_record/validations/associated.rb')
0 files changed, 0 insertions, 0 deletions