diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-05 20:38:02 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2012-08-05 20:38:02 -0300 |
commit | f784f218ea30f60c708db26e47eb336e824cdf5d (patch) | |
tree | c8a0693102019544d2923a6177cca78f193c5140 | |
parent | 447b6a4e678ab1618bdcd130e30c288b0a25297a (diff) | |
parent | e7e86566ccc7bfb3fa0046961ef38f5431d55e35 (diff) | |
download | rails-f784f218ea30f60c708db26e47eb336e824cdf5d.tar.gz rails-f784f218ea30f60c708db26e47eb336e824cdf5d.tar.bz2 rails-f784f218ea30f60c708db26e47eb336e824cdf5d.zip |
Merge pull request #7140 from seamusabshere/patch-1
Make sure :environment task is executed before db:schema:load or
db:structure:load
-rw-r--r-- | activerecord/CHANGELOG.md | 5 | ||||
-rw-r--r-- | activerecord/lib/active_record/railties/databases.rake | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md index 8275577467..a99d7fdde8 100644 --- a/activerecord/CHANGELOG.md +++ b/activerecord/CHANGELOG.md @@ -1,5 +1,10 @@ ## Rails 4.0.0 (unreleased) ## +* Make sure `:environment` task is executed before `db:schema:load` or `db:structure:load` + Fixes #4772. + + *Seamus Abshere* + * Allow Relation#merge to take a proc. This was requested by DHH to allow creating of one's own custom diff --git a/activerecord/lib/active_record/railties/databases.rake b/activerecord/lib/active_record/railties/databases.rake index e0659700b6..4e5ec4f739 100644 --- a/activerecord/lib/active_record/railties/databases.rake +++ b/activerecord/lib/active_record/railties/databases.rake @@ -241,7 +241,7 @@ db_namespace = namespace :db do end end - task :load_if_ruby => 'db:create' do + task :load_if_ruby => [:environment, 'db:create'] do db_namespace["schema:load"].invoke if ActiveRecord::Base.schema_format == :ruby end @@ -326,7 +326,7 @@ db_namespace = namespace :db do end end - task :load_if_sql => 'db:create' do + task :load_if_sql => [:environment, 'db:create'] do db_namespace["structure:load"].invoke if ActiveRecord::Base.schema_format == :sql end end |