Skip to content

Commit 4dcf0e7

Browse files
authored
Merge pull request #20 from zendesk/pschambacher/rails5.2.again
Compatibility with Rails 5.2.0
2 parents c76754e + d2a2122 commit 4dcf0e7

File tree

9 files changed

+46
-40
lines changed

9 files changed

+46
-40
lines changed

Gemfile.lock

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,27 @@ PATH
22
remote: .
33
specs:
44
migration_tools (1.4.0)
5-
activerecord (>= 3.2.6, < 5.2)
5+
activerecord (>= 3.2.6, < 6.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
activemodel (5.1.0)
11-
activesupport (= 5.1.0)
12-
activerecord (5.1.0)
13-
activemodel (= 5.1.0)
14-
activesupport (= 5.1.0)
15-
arel (~> 8.0)
16-
activesupport (5.1.0)
10+
activemodel (5.2.0)
11+
activesupport (= 5.2.0)
12+
activerecord (5.2.0)
13+
activemodel (= 5.2.0)
14+
activesupport (= 5.2.0)
15+
arel (>= 9.0)
16+
activesupport (5.2.0)
1717
concurrent-ruby (~> 1.0, >= 1.0.2)
18-
i18n (~> 0.7)
18+
i18n (>= 0.7, < 2)
1919
minitest (~> 5.1)
2020
tzinfo (~> 1.1)
21-
arel (8.0.0)
21+
arel (9.0.0)
2222
bump (0.5.3)
2323
concurrent-ruby (1.0.5)
24-
i18n (0.8.1)
24+
i18n (1.0.1)
25+
concurrent-ruby (~> 1.0)
2526
iconv (1.0.4)
2627
metaclass (0.0.4)
2728
minitest (5.8.3)
@@ -32,7 +33,7 @@ GEM
3233
rake (10.4.2)
3334
sqlite3 (1.3.11)
3435
thread_safe (0.3.6)
35-
tzinfo (1.2.3)
36+
tzinfo (1.2.5)
3637
thread_safe (~> 0.1)
3738
wwtd (1.3.0)
3839

@@ -51,4 +52,4 @@ DEPENDENCIES
5152
wwtd
5253

5354
BUNDLED WITH
54-
1.14.6
55+
1.16.2

gemfiles/rails3.2.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: ..
33
specs:
44
migration_tools (1.4.0)
5-
activerecord (>= 3.2.6, < 5.2)
5+
activerecord (>= 3.2.6, < 6.0)
66

77
GEM
88
remote: https://rubygems.org/
@@ -51,4 +51,4 @@ DEPENDENCIES
5151
wwtd
5252

5353
BUNDLED WITH
54-
1.16.0
54+
1.16.2

gemfiles/rails4.2.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: ..
33
specs:
44
migration_tools (1.4.0)
5-
activerecord (>= 3.2.6, < 5.2)
5+
activerecord (>= 3.2.6, < 6.0)
66

77
GEM
88
remote: https://rubygems.org/
@@ -55,4 +55,4 @@ DEPENDENCIES
5555
wwtd
5656

5757
BUNDLED WITH
58-
1.16.0
58+
1.16.2

gemfiles/rails5.0.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: ..
33
specs:
44
migration_tools (1.4.0)
5-
activerecord (>= 3.2.6, < 5.2)
5+
activerecord (>= 3.2.6, < 6.0)
66

77
GEM
88
remote: https://rubygems.org/
@@ -50,4 +50,4 @@ DEPENDENCIES
5050
wwtd
5151

5252
BUNDLED WITH
53-
1.16.0
53+
1.16.2

gemfiles/rails5.1.gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ PATH
22
remote: ..
33
specs:
44
migration_tools (1.4.0)
5-
activerecord (>= 3.2.6, < 5.2)
5+
activerecord (>= 3.2.6, < 6.0)
66

77
GEM
88
remote: https://rubygems.org/
@@ -50,4 +50,4 @@ DEPENDENCIES
5050
wwtd
5151

5252
BUNDLED WITH
53-
1.16.0
53+
1.16.2

gemfiles/rails5.2.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
source "https://rubygems.org"
22

3-
gem "activerecord", "~> 5.2.0.beta2"
3+
gem "activerecord", "~> 5.2.0"
44

55
gemspec path: "../"

gemfiles/rails5.2.gemfile.lock

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,45 @@ PATH
22
remote: ..
33
specs:
44
migration_tools (1.4.0)
5-
activerecord (>= 3.2.6, < 5.2)
5+
activerecord (>= 3.2.6, < 6.0)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
activemodel (5.2.0.beta2)
11-
activesupport (= 5.2.0.beta2)
12-
activerecord (5.2.0.beta2)
13-
activemodel (= 5.2.0.beta2)
14-
activesupport (= 5.2.0.beta2)
10+
activemodel (5.2.0)
11+
activesupport (= 5.2.0)
12+
activerecord (5.2.0)
13+
activemodel (= 5.2.0)
14+
activesupport (= 5.2.0)
1515
arel (>= 9.0)
16-
activesupport (5.2.0.beta2)
16+
activesupport (5.2.0)
1717
concurrent-ruby (~> 1.0, >= 1.0.2)
18-
i18n (~> 0.7)
18+
i18n (>= 0.7, < 2)
1919
minitest (~> 5.1)
2020
tzinfo (~> 1.1)
2121
arel (9.0.0)
22-
bump (0.5.4)
22+
bump (0.6.1)
2323
concurrent-ruby (1.0.5)
24-
i18n (0.9.1)
24+
i18n (1.0.1)
2525
concurrent-ruby (~> 1.0)
2626
metaclass (0.0.4)
27-
minitest (5.10.3)
27+
minitest (5.11.3)
2828
minitest-rg (5.2.0)
2929
minitest (~> 5.0)
30-
mocha (1.3.0)
30+
mocha (1.5.0)
3131
metaclass (~> 0.0.1)
32-
rake (12.3.0)
32+
rake (12.3.1)
3333
sqlite3 (1.3.13)
3434
thread_safe (0.3.6)
35-
tzinfo (1.2.4)
35+
tzinfo (1.2.5)
3636
thread_safe (~> 0.1)
3737
wwtd (1.3.0)
3838

3939
PLATFORMS
4040
ruby
4141

4242
DEPENDENCIES
43-
activerecord (~> 5.2.0.beta2)
43+
activerecord (~> 5.2.0)
4444
bump
4545
migration_tools!
4646
minitest
@@ -51,4 +51,4 @@ DEPENDENCIES
5151
wwtd
5252

5353
BUNDLED WITH
54-
1.16.0
54+
1.16.2

lib/migration_tools/tasks.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@ def migrations_paths
2929

3030
def migrator(target_version = nil)
3131
if ActiveRecord::VERSION::MAJOR > 3
32-
ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations(migrations_paths), target_version)
32+
migrations = if defined?(::ActiveRecord::MigrationContext)
33+
ActiveRecord::MigrationContext.new(migrations_paths).migrations
34+
else
35+
ActiveRecord::Migrator.migrations(migrations_paths)
36+
end
37+
ActiveRecord::Migrator.new(:up, migrations, target_version)
3338
else
3439
ActiveRecord::Migrator.new(:up, migrations_paths, target_version)
3540
end

migration_tools.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new "migration_tools", "1.4.0" do |s|
77
s.files = `git ls-files lib`.split("\n")
88
s.license = "Apache License Version 2.0"
99

10-
s.add_runtime_dependency "activerecord", '>= 3.2.6', '< 5.2'
10+
s.add_runtime_dependency "activerecord", '>= 3.2.6', '< 6.0'
1111

1212
s.add_development_dependency "rake"
1313
s.add_development_dependency "bump"

0 commit comments

Comments
 (0)