migration_tools 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/migration_tools/tasks.rb +8 -8
  3. metadata +16 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc34d73e158f764446cf9303864ad26b8b64e8d7
4
- data.tar.gz: 0f4d426b8396fb74c88f47ade90689d4deb852eb
3
+ metadata.gz: fb346f046cdd5dfa19061ce3ce07920766774f25
4
+ data.tar.gz: bb7ea53335abd3ae2426d73c7cc60175bbbde450
5
5
  SHA512:
6
- metadata.gz: 4c4c6bed0eb9ee17b18910dd3c2a5a229eac4b5a1168a97f05ad5d25c9c41b5d82f3f3cf9a868889787e5cb9f4d2dab98994e91e476d3488df5839c7fa281db4
7
- data.tar.gz: 02976da347a1dc51151abea84bb4ea50e8f2cbf4c315ef7c1127a2c4d18aaaef930a869293a344bd69b01d57dd136078e7f83e0d7fa79eaf12703a4b9303c0a4
6
+ metadata.gz: dfc016231d6400e0e67df29f157f8e0d77bc2cee960e2467c799da4944fd1fded2dcd607b847cb4c450a2088d95c7ca4fafb9b20c4a3c94438120d6c0eb51b81
7
+ data.tar.gz: 7ea498034b6d31a78bc5b11598647d41e64c0b924351bd416e0b474bd618b19d717a94346347365beadca7f1993b7f2e3e18ceabe762e0d40182831ea3b45fea
@@ -24,15 +24,15 @@ module MigrationTools
24
24
  end
25
25
 
26
26
  def migrations_paths
27
- if ActiveRecord::Migrator.respond_to?(:migrations_paths)
28
- ActiveRecord::Migrator.migrations_paths
29
- else
30
- 'db/migrate'
31
- end
27
+ ActiveRecord::Migrator.migrations_paths
32
28
  end
33
29
 
34
- def migrator
35
- @migrator ||= ActiveRecord::Migrator.new(:up, migrations_paths)
30
+ def migrator(target_version = nil)
31
+ if ActiveRecord::VERSION::MAJOR > 3
32
+ ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations(migrations_paths), target_version)
33
+ else
34
+ ActiveRecord::Migrator.new(:up, migrations_paths, target_version)
35
+ end
36
36
  end
37
37
 
38
38
  def pending_migrations
@@ -72,7 +72,7 @@ module MigrationTools
72
72
  notify "Your database schema is up to date"
73
73
  else
74
74
  pending_migrations.each do |migration|
75
- ActiveRecord::Migrator.run(:up, migrations_paths, migration.version)
75
+ migrator(migration.version).run
76
76
  end
77
77
 
78
78
  Rake::Task["db:schema:dump"].invoke if ActiveRecord::Base.schema_format == :ruby
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: migration_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Morten Primdahl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-30 00:00:00.000000000 Z
11
+ date: 2015-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0'
47
+ - !ruby/object:Gem::Dependency
48
+ name: bump
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - ">="
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
47
61
  - !ruby/object:Gem::Dependency
48
62
  name: mocha
49
63
  requirement: !ruby/object:Gem::Requirement