aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@plataformatec.com.br>2012-06-10 02:33:14 -0700
committerJosé Valim <jose.valim@plataformatec.com.br>2012-06-10 02:33:14 -0700
commit4845c0685aa3983b4685d4afe141ac5d398521bc (patch)
tree76ad4b6c69694928f8d7aa920e388f19cbbbdf0f /railties/lib
parentfdcc252e81629eb2d142da32d47037fc5cf4030d (diff)
parentd741a4c6f863778c5ebf04b21f6c3292091c13a7 (diff)
downloadrails-4845c0685aa3983b4685d4afe141ac5d398521bc.tar.gz
rails-4845c0685aa3983b4685d4afe141ac5d398521bc.tar.bz2
rails-4845c0685aa3983b4685d4afe141ac5d398521bc.zip
Merge pull request #6665 from schneems/schneems/raise-migration-error
Notify A User they Have Pending Migrations
Diffstat (limited to 'railties/lib')
-rw-r--r--railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt3
-rw-r--r--railties/lib/rails/generators/rails/app/templates/test/test_helper.rb2
2 files changed, 5 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
index 24bcec854c..01f9396403 100644
--- a/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
+++ b/railties/lib/rails/generators/rails/app/templates/config/environments/development.rb.tt
@@ -26,6 +26,9 @@
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL).
config.active_record.auto_explain_threshold_in_seconds = 0.5
+
+ # Raise an error on page load if there are pending migrations
+ config.active_record.migration_error = :page_load
<%- end -%>
<%- unless options.skip_sprockets? -%>
diff --git a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
index a8f7aeac7d..0090293200 100644
--- a/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
+++ b/railties/lib/rails/generators/rails/app/templates/test/test_helper.rb
@@ -4,6 +4,8 @@ require 'rails/test_help'
class ActiveSupport::TestCase
<% unless options[:skip_active_record] -%>
+ ActiveRecord::Migration.check_pending!
+
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests