aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/CHANGELOG.md3
-rw-r--r--activerecord/lib/active_record/migration.rb4
-rw-r--r--activerecord/test/cases/migration_test.rb4
3 files changed, 7 insertions, 4 deletions
diff --git a/activerecord/CHANGELOG.md b/activerecord/CHANGELOG.md
index 55cc85a63d..9daae27b36 100644
--- a/activerecord/CHANGELOG.md
+++ b/activerecord/CHANGELOG.md
@@ -1,5 +1,8 @@
## Rails 4.0.0 (unreleased) ##
+* Added `ActiveRecord::Migration.check_pending!` that raises an error if
+ migrations are pending. *Richard Schneeman*
+
* Added `#destroy!` which acts like `#destroy` but will raise an
`ActiveRecord::RecordNotDestroyed` exception instead of returning `false`.
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb
index a0169203b0..084f0272b2 100644
--- a/activerecord/lib/active_record/migration.rb
+++ b/activerecord/lib/active_record/migration.rb
@@ -342,7 +342,7 @@ module ActiveRecord
def call(env)
ActiveRecord::Migration.check_pending!
- status, headers, body = @app.call(env)
+ @app.call(env)
end
end
@@ -351,7 +351,7 @@ module ActiveRecord
end
def self.check_pending!
- raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator::needs_migrations?
+ raise ActiveRecord::PendingMigrationError if ActiveRecord::Migrator.needs_migration?
end
def self.method_missing(name, *args, &block) # :nodoc:
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index ee02e4ddda..3c0d2b18d9 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -63,12 +63,12 @@ class MigrationTest < ActiveRecord::TestCase
ActiveRecord::Migrator.up(migrations_path)
assert_equal 3, ActiveRecord::Migrator.current_version
assert_equal 3, ActiveRecord::Migrator.last_version
- assert_equal false, ActiveRecord::Migrator.needs_migrations?
+ assert_equal false, ActiveRecord::Migrator.needs_migration?
ActiveRecord::Migrator.down(MIGRATIONS_ROOT + "/valid")
assert_equal 0, ActiveRecord::Migrator.current_version
assert_equal 3, ActiveRecord::Migrator.last_version
- assert_equal true, ActiveRecord::Migrator.needs_migrations?
+ assert_equal true, ActiveRecord::Migrator.needs_migration?
end
def test_create_table_with_force_true_does_not_drop_nonexisting_table