mongoid_rails_migrations 1.2.1 → 1.3.0

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
- SHA1:
3
- metadata.gz: c8fc6474257b2d2e0046a797c410b91e3ccac8e1
4
- data.tar.gz: aaed74adb2274149fe6dae16912cfa6f97dcf739
2
+ SHA256:
3
+ metadata.gz: 8775f1eec59ab5b9b48253d924c225ef8f4a381e25e70b8666f1f5439a8db3d7
4
+ data.tar.gz: 896306d933de2c622e4ff3465801b300c16287a027edbb70c6881277c4643c41
5
5
  SHA512:
6
- metadata.gz: 9606b16b2eab7e1e73e072eabc5bc96de07cc920d0f2c4c88352d21af7f3719ed180879fc6ce0ca6a817b2b3228d1abcac99ee98687ae9f6d040b97f7bf38780
7
- data.tar.gz: 6b1c82473b629467e43239a74ed7de02ec4704fdd3c0a9ec2aadc3c8e6f3d51e5468bcb62f849d52c15892ccb8f28baa0b9c054a2e312af0a45b6df2b68088bb
6
+ metadata.gz: bf0e7d1b3827d1c2af5c1c5f564a84a038dc750f7d1834198e7bf9b7e9eba9c6e5d60924c56e799eb23a71c3c972c19bd6f3796a2196d38b6c6f35646990dc51
7
+ data.tar.gz: e4bad977cedcba39cc704c2ee23a765827a02834a6f45bbc65b52421a2b968f7fb174db82aeccd4b15e778c671a0232dfd65d21d185cb1348387470a04659eb4
@@ -61,7 +61,7 @@ module Mongoid #:nodoc
61
61
  #
62
62
  class Migration
63
63
  @@verbose = true
64
- cattr_accessor :verbose
64
+ cattr_accessor :verbose, :after_migrate
65
65
 
66
66
  class << self
67
67
  def up_with_benchmarks #:nodoc:
@@ -89,6 +89,11 @@ module Mongoid #:nodoc
89
89
  when :down then announce "reverted (%.4fs)" % time.real; write
90
90
  end
91
91
 
92
+ begin
93
+ @@after_migrate.call(@buffer_output, name, direction) if @@after_migrate
94
+ rescue => e
95
+ say("Error in after_migrate hook: #{e}")
96
+ end
92
97
  result
93
98
  end
94
99
 
@@ -112,6 +117,8 @@ module Mongoid #:nodoc
112
117
  end
113
118
 
114
119
  def write(text="")
120
+ @buffer_output ||= ""
121
+ @buffer_output += text + "\n"
115
122
  puts(text) if verbose
116
123
  end
117
124
 
@@ -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/")
77
+ Mongoid::Migrator.status(Mongoid::Migrator.migrations_path)
78
78
  end
79
79
  end
80
80
 
@@ -88,7 +88,7 @@ namespace :db do
88
88
  task :rollback_to => :environment do
89
89
  version = ENV["VERSION"] ? ENV["VERSION"].to_i : nil
90
90
  raise "VERSION is required" unless version
91
- Mongoid::Migrator.rollback_to('db/migrate/', version)
91
+ Mongoid::Migrator.rollback_to(Mongoid::Migrator.migrations_path, version)
92
92
  end
93
93
 
94
94
  namespace :schema do
@@ -1,3 +1,3 @@
1
1
  module MongoidRailsMigrations #:nodoc:
2
- VERSION = '1.2.1'
2
+ VERSION = '1.3.0'
3
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.1
4
+ version: 1.3.0
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: 2019-02-04 00:00:00.000000000 Z
11
+ date: 2020-12-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -145,10 +145,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  requirements: []
148
- rubyforge_project:
149
- rubygems_version: 2.5.1
148
+ rubygems_version: 3.1.2
150
149
  signing_key:
151
150
  specification_version: 4
152
151
  summary: Data migrations for Mongoid.
153
152
  test_files: []
154
- has_rdoc: