mongoid_rails_migrations 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42339e4043e1ab4647e09def69fbc4d2fc674486da3113a83d461696d50d1b0c
|
4
|
+
data.tar.gz: ec3472e01a1071ced5db4da967c6c6b1627a4d9219b8abda84b19871514766fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84b7956dcac388376845c973fd0c1744c396fa38bff504257c361bfdda9b6c00b618000f418fb2d20f0c6ffae9a3a1a6649d0ec9728c3639bef583252ad1f620
|
7
|
+
data.tar.gz: 54a713f8b7d3c3280e5b83a6233ffa8eecbef7254d20a55b08c705b85342511191fad0e9bd8fcf0162dd8e8ab3ff6b1fca296e58fbe9a779a436f06b1a18b61f
|
@@ -61,7 +61,7 @@ module Mongoid #:nodoc
|
|
61
61
|
#
|
62
62
|
class Migration
|
63
63
|
@@verbose = true
|
64
|
-
cattr_accessor :verbose, :after_migrate
|
64
|
+
cattr_accessor :verbose, :after_migrate, :buffer_output
|
65
65
|
|
66
66
|
class << self
|
67
67
|
def up_with_benchmarks #:nodoc:
|
@@ -90,7 +90,8 @@ module Mongoid #:nodoc
|
|
90
90
|
end
|
91
91
|
|
92
92
|
begin
|
93
|
-
@@after_migrate.call(
|
93
|
+
@@after_migrate.call(@@buffer_output, name, direction, false) if @@after_migrate
|
94
|
+
@@buffer_output = nil
|
94
95
|
rescue => e
|
95
96
|
say("Error in after_migrate hook: #{e}")
|
96
97
|
end
|
@@ -117,8 +118,8 @@ module Mongoid #:nodoc
|
|
117
118
|
end
|
118
119
|
|
119
120
|
def write(text="")
|
120
|
-
|
121
|
-
|
121
|
+
@@buffer_output ||= ""
|
122
|
+
@@buffer_output += text + "\n"
|
122
123
|
puts(text) if verbose
|
123
124
|
end
|
124
125
|
|
@@ -332,6 +333,13 @@ module Mongoid #:nodoc
|
|
332
333
|
migration.migrate(@direction)
|
333
334
|
record_version_state_after_migrating(migration.version)
|
334
335
|
rescue => e
|
336
|
+
output = Migration.buffer_output + "An error has occurred, #{migration.version} and all later migrations canceled:\n\n#{e}\n#{e.backtrace.join("\n")}"
|
337
|
+
begin
|
338
|
+
Migration.after_migrate.call(output, migration.name, @direction, true) if Migration.after_migrate
|
339
|
+
Migration.buffer_output = nil
|
340
|
+
rescue => error
|
341
|
+
puts("Error in after_migrate hook: #{error}")
|
342
|
+
end
|
335
343
|
raise StandardError, "An error has occurred, #{migration.version} and all later migrations canceled:\n\n#{e}", e.backtrace
|
336
344
|
end
|
337
345
|
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.
|
4
|
+
version: 1.4.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:
|
11
|
+
date: 2021-01-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|