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 +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/mongoid/sleeping_king_studios/orderable.rb +11 -8
- data/lib/mongoid/sleeping_king_studios/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e7f0cf1a7141d9df475cec3f705d3db481d7c16
|
4
|
+
data.tar.gz: 2d3cba51c5d27ab0bca1a6eb0c9c76bf5c30de39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 81902f2321749be29d9acd4e94362edf4f379139a6a9e79e6c6fb4980dbb593953f578acc8f02540a09c3c88c571027d55f7ff6fe496a292ad29d726db4cbc0f
|
7
|
+
data.tar.gz: e1ca4e841933ac79bc07fcf167be29e390ce77c9a6f5d30b75b669bc3bc14f8baf7e94d2366040ee7eeb73bf57aeccbb12263b94fa20d695c8d479491a52e241
|
data/CHANGELOG.md
CHANGED
@@ -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
|
-
|
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
|
-
|
97
|
-
|
98
|
-
|
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
|
|
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.
|
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.
|
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.
|
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
|