aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorschneems <richard.schneeman@gmail.com>2016-01-08 09:27:25 -0600
committerschneems <richard.schneeman@gmail.com>2016-01-08 09:27:25 -0600
commitde2cb20117af68cef4126d8998cc63e178c58187 (patch)
tree9cfa86dbd308f0ec1cfef9e45e3bcf9276885db0 /activerecord/test/cases
parenta76c4233a9ee9ffbf413c4b8353e73e8ffbeb3a5 (diff)
downloadrails-de2cb20117af68cef4126d8998cc63e178c58187.tar.gz
rails-de2cb20117af68cef4126d8998cc63e178c58187.tar.bz2
rails-de2cb20117af68cef4126d8998cc63e178c58187.zip
Use hash like syntax for InternalMetadata
Discussion: https://github.com/rails/rails/pull/22967#discussion_r49137035
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/migration_test.rb4
-rw-r--r--activerecord/test/cases/tasks/database_tasks_test.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb
index 2f7859a7be..bd60b64ee2 100644
--- a/activerecord/test/cases/migration_test.rb
+++ b/activerecord/test/cases/migration_test.rb
@@ -380,7 +380,7 @@ class MigrationTest < ActiveRecord::TestCase
old_path = ActiveRecord::Migrator.migrations_paths
ActiveRecord::Migrator.migrations_paths = migrations_path
- assert_equal current_env, ActiveRecord::InternalMetadata.value_for("environment")
+ assert_equal current_env, ActiveRecord::InternalMetadata[:environment]
original_rails_env = ENV["RAILS_ENV"]
original_rack_env = ENV["RACK_ENV"]
@@ -391,7 +391,7 @@ class MigrationTest < ActiveRecord::TestCase
sleep 1 # mysql by default does not store fractional seconds in the database
ActiveRecord::Migrator.up(migrations_path)
- assert_equal new_env, ActiveRecord::InternalMetadata.value_for("environment")
+ assert_equal new_env, ActiveRecord::InternalMetadata[:environment]
ensure
ActiveRecord::Migrator.migrations_paths = old_path
ENV["RAILS_ENV"] = original_rails_env
diff --git a/activerecord/test/cases/tasks/database_tasks_test.rb b/activerecord/test/cases/tasks/database_tasks_test.rb
index e91a222534..326373791c 100644
--- a/activerecord/test/cases/tasks/database_tasks_test.rb
+++ b/activerecord/test/cases/tasks/database_tasks_test.rb
@@ -23,7 +23,7 @@ module ActiveRecord
ActiveRecord::Migrator.stubs(:current_version).returns(1)
protected_environments = ActiveRecord::Base.protected_environments.dup
- current_env = ActiveRecord::ConnectionHandling::DEFAULT_ENV.call
+ current_env = ActiveRecord::Migrator.current_environment
assert !protected_environments.include?(current_env)
# Assert no error
ActiveRecord::Tasks::DatabaseTasks.check_protected_environments!