diff options
author | José Valim <jose.valim@gmail.com> | 2012-06-10 11:38:37 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2012-06-10 11:38:37 +0200 |
commit | 03f2249153ae4d2078646e6796d8b9e5ef747fba (patch) | |
tree | 680e70837788456b717524fd2f046faa669e2ca0 | |
parent | 4845c0685aa3983b4685d4afe141ac5d398521bc (diff) | |
download | rails-03f2249153ae4d2078646e6796d8b9e5ef747fba.tar.gz rails-03f2249153ae4d2078646e6796d8b9e5ef747fba.tar.bz2 rails-03f2249153ae4d2078646e6796d8b9e5ef747fba.zip |
Use . instead of :: for class methods, add CHANGELOG entries
-rw-r--r-- | activerecord/CHANGELOG.md | 3 | ||||
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 4 | ||||
-rw-r--r-- | railties/CHANGELOG.md | 2 | ||||
-rw-r--r-- | railties/test/application/configuration_test.rb | 2 |
5 files changed, 10 insertions, 5 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 diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index a6abe5ee97..e19aa68407 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,5 +1,7 @@ ## Rails 4.0.0 (unreleased) ## +* Set `config.active_record.migration_error` to `:page_load` for development *Richard Schneeman* + * Add runner to Rails::Railtie as a hook called just after runner starts. *José Valim & kennyj* * Add `/rails/info/routes` path, displays same information as `rake routes` *Richard Schneeman & Andrew White* diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 75190372ab..7193dfdef5 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -49,7 +49,7 @@ module ApplicationTests RUBY require "#{app_path}/config/environment" - ActiveRecord::Migrator.stubs(:needs_migrations?).returns(true) + ActiveRecord::Migrator.stubs(:needs_migration?).returns(true) get "/foo" assert_equal 500, last_response.status |