mongoid-sleeping_king_studios 0.7.8 → 0.7.9

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: 2ed2311e927cfdbb0ce3dbf48993003c1a85dee3
4
- data.tar.gz: d98b75d75cced592915a2501d4c3d4fded8e9499
3
+ metadata.gz: 3e7f0cf1a7141d9df475cec3f705d3db481d7c16
4
+ data.tar.gz: 2d3cba51c5d27ab0bca1a6eb0c9c76bf5c30de39
5
5
  SHA512:
6
- metadata.gz: 89c269b96bc27a8c0896c352a97cc0719c0d2b4b9b53b55bf3ef20a06d037e0c68bcc928c06a17a6edeb30c64090cd2bedecd78b50a941eaa8a4865a5c3bce68
7
- data.tar.gz: 307415e029fe67a4056bcbe19785cb467c8eed72524233e8368ff9040e407e00d8425ff8fd951a6786a2b1042fc5433687850bf82d7d2030ad2adf4a8cd38797
6
+ metadata.gz: 81902f2321749be29d9acd4e94362edf4f379139a6a9e79e6c6fb4980dbb593953f578acc8f02540a09c3c88c571027d55f7ff6fe496a292ad29d726db4cbc0f
7
+ data.tar.gz: e1ca4e841933ac79bc07fcf167be29e390ce77c9a6f5d30b75b669bc3bc14f8baf7e94d2366040ee7eeb73bf57aeccbb12263b94fa20d695c8d479491a52e241
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.9
4
+
5
+ ### Resolved Issues
6
+
7
+ * Rewrote internal Orderable::define_callbacks to resolve reliance on
8
+ unsupported early return behavior in ActiveSupport::Callbacks, causing errors
9
+ when used with ActiveSupport 4.1+.
10
+
3
11
  ## 0.7.8
4
12
 
5
13
  ### New Features
@@ -73,10 +73,7 @@ module Mongoid::SleepingKingStudios
73
73
  order_index = ordering.index(self)
74
74
 
75
75
  if order_index.nil?
76
- if send(metadata.field_was).nil?
77
- # Both the old and new values are nil, so mission accomplished.
78
- return
79
- else
76
+ unless send(metadata.field_was).nil?
80
77
  # The old value wasn't nil, so remember it and set the new value,
81
78
  # then start looping through the ordered collection at the old
82
79
  # value.
@@ -87,15 +84,21 @@ module Mongoid::SleepingKingStudios
87
84
 
88
85
  # Set the value in the datastore.
89
86
  set(metadata.field_name => order_index)
87
+
88
+ # Atomically update the subsequent documents in the collection.
89
+ ordering[order_index..-1].each_with_index do |object, i|
90
+ object.set(metadata.field_name => (order_index + i))
91
+ end # each
90
92
  end # unless
91
93
  else
92
94
  # Update the current instance.
93
95
  self[metadata.field_name] = order_index
94
- end # if
95
96
 
96
- ordering[order_index..-1].each_with_index do |object, i|
97
- object.set(metadata.field_name => (order_index + i))
98
- end # each
97
+ # Atomically update the subsequent documents in the collection.
98
+ ordering[order_index..-1].each_with_index do |object, i|
99
+ object.set(metadata.field_name => (order_index + i))
100
+ end # each
101
+ end # if
99
102
  end # callback
100
103
  end # module method define_callbacks
101
104
 
@@ -3,6 +3,6 @@
3
3
  module Mongoid
4
4
  module SleepingKingStudios
5
5
  # The current version of the gem.
6
- VERSION = '0.7.8'
6
+ VERSION = '0.7.9'
7
7
  end # module
8
8
  end # module
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-sleeping_king_studios
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.8
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob "Merlin" Smith
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0.alpha.1
19
+ version: 4.0.0.rc.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.0.0.alpha.1
26
+ version: 4.0.0.rc.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sleeping_king_studios-ext
29
29
  requirement: !ruby/object:Gem::Requirement