diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-04-30 16:11:24 -0300 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-04-30 16:11:24 -0300 |
commit | 8ef45853034269396435143d1e7fa99354616863 (patch) | |
tree | 5584bcab167532f24a1cb03ad05caeb7d84d9e31 /activerecord | |
parent | e7de870ec75664c723bc3af8a24ed01f79267e07 (diff) | |
parent | 76f7da0c6516bed5d1375b5d55dde71ba71df4f7 (diff) | |
download | rails-8ef45853034269396435143d1e7fa99354616863.tar.gz rails-8ef45853034269396435143d1e7fa99354616863.tar.bz2 rails-8ef45853034269396435143d1e7fa99354616863.zip |
Merge pull request #24791 from maclover7/jm-rm-ar-rails-mention
Replace `Rails.version.to_f` with Active Record
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/migration.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/migration_test.rb | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/migration.rb b/activerecord/lib/active_record/migration.rb index 33c236a732..5dc7020944 100644 --- a/activerecord/lib/active_record/migration.rb +++ b/activerecord/lib/active_record/migration.rb @@ -528,7 +528,7 @@ module ActiveRecord end def self.current_version - Rails.version.to_f + ActiveRecord::VERSION::STRING.to_f end MigrationFilenameRegexp = /\A([0-9]+)_([_a-z0-9]*)\.?([_a-z0-9]*)?\.rb\z/ # :nodoc: diff --git a/activerecord/test/cases/migration_test.rb b/activerecord/test/cases/migration_test.rb index 5a6d2ce80c..a4b0de3f4e 100644 --- a/activerecord/test/cases/migration_test.rb +++ b/activerecord/test/cases/migration_test.rb @@ -69,6 +69,10 @@ class MigrationTest < ActiveRecord::TestCase ActiveRecord::Migration.verbose = @verbose_was end + def test_migration_version_matches_component_version + assert_equal ActiveRecord::VERSION::STRING.to_f, ActiveRecord::Migration.current_version + end + def test_migrator_versions migrations_path = MIGRATIONS_ROOT + "/valid" old_path = ActiveRecord::Migrator.migrations_paths |