mongoid_rails_migrations 1.2.0 → 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 258e610c43efd94878675b841b0c046473d033d1
4
- data.tar.gz: 3e2ce38153ee9bfc6ff7b3a2b0c0c87e8e823d69
3
+ metadata.gz: c8fc6474257b2d2e0046a797c410b91e3ccac8e1
4
+ data.tar.gz: aaed74adb2274149fe6dae16912cfa6f97dcf739
5
5
  SHA512:
6
- metadata.gz: 311fa5ed6d1f24305753750b4967caf4660b8dd106af34e7a86960e2d23cd674ddf8fa2b5af271ebdda892dd62e585494c60c3631ed6d64b66fc30e8af1df153
7
- data.tar.gz: 98da99b5a0688b958a731c02e6a7291c4a3292908da441bf3bcc8e6eb5ec0de30de505471b82112a16a052d9cf7183e9bda85cf866815a0dfdc5ea9a8594f151
6
+ metadata.gz: 9606b16b2eab7e1e73e072eabc5bc96de07cc920d0f2c4c88352d21af7f3719ed180879fc6ce0ca6a817b2b3228d1abcac99ee98687ae9f6d040b97f7bf38780
7
+ data.tar.gz: 6b1c82473b629467e43239a74ed7de02ec4704fdd3c0a9ec2aadc3c8e6f3d51e5468bcb62f849d52c15892ccb8f28baa0b9c054a2e312af0a45b6df2b68088bb
@@ -198,12 +198,8 @@ module Mongoid #:nodoc
198
198
  end
199
199
  end
200
200
 
201
- def status(migrations_path, target_version = nil)
202
- case
203
- when target_version.nil? then new(:up, migrations_path, target_version).status
204
- when current_version > target_version then new(:down, migrations_path, target_version).status
205
- else new(:up, migrations_path, target_version).status
206
- end
201
+ def status(migrations_path)
202
+ new(:up, migrations_path).status
207
203
  end
208
204
 
209
205
  def rollback(migrations_path, steps=1)
@@ -339,8 +335,9 @@ module Mongoid #:nodoc
339
335
  puts "\ndatabase: #{database_name}\n\n"
340
336
  puts "#{'Status'.center(8)} #{'Migration ID'.ljust(14)} Migration Name"
341
337
  puts "-" * 50
342
- to_run_migrations.each do |migration|
343
- status = migrated.include?(migration.version.to_i) ? 'down' : 'up'
338
+ up_migrations = migrated.to_set
339
+ migrations.each do |migration|
340
+ status = up_migrations.include?(migration.version.to_i) ? 'up' : 'down'
344
341
  puts "#{status.center(8)} #{migration.version.to_s.ljust(14)} #{migration.name}"
345
342
  end
346
343
  end
@@ -400,16 +397,6 @@ module Mongoid #:nodoc
400
397
  runnable
401
398
  end
402
399
 
403
- def to_run_migrations
404
- runnable_migrations.select do |migration|
405
- if up?
406
- !migrated.include?(migration.version.to_i)
407
- elsif down?
408
- migrated.include?(migration.version.to_i)
409
- end
410
- end
411
- end
412
-
413
400
  def migrated
414
401
  @migrated_versions ||= self.class.get_all_versions
415
402
  end
@@ -74,7 +74,7 @@ namespace :db do
74
74
 
75
75
  desc 'Display status of migrations'
76
76
  task :status => :environment do
77
- Mongoid::Migrator.status("db/migrate/", ENV["VERSION"] ? ENV["VERSION"].to_i : nil)
77
+ Mongoid::Migrator.status("db/migrate/")
78
78
  end
79
79
  end
80
80
 
@@ -1,3 +1,3 @@
1
1
  module MongoidRailsMigrations #:nodoc:
2
- VERSION = '1.2.0'
3
- end
2
+ VERSION = '1.2.1'
3
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid_rails_migrations
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
  - Alan Da Costa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-24 00:00:00.000000000 Z
11
+ date: 2019-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler