noodall-core 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/noodall/node.rb +8 -8
- data/noodall-core.gemspec +1 -1
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/lib/noodall/node.rb
CHANGED
@@ -148,17 +148,17 @@ module Noodall
|
|
148
148
|
parent.nil? or parent.updatable_by?(user)
|
149
149
|
end
|
150
150
|
|
151
|
-
|
152
|
-
|
153
|
-
self.class.all(options.merge(:_id => {"$ne" => self._id}, parent_id_field => self[parent_id_field], :order => tree_order))
|
151
|
+
def siblings
|
152
|
+
self.class.where(:_id => {:$ne => self._id}, parent_id_field => self[parent_id_field]).order(tree_order)
|
154
153
|
end
|
155
154
|
|
156
|
-
def self_and_siblings
|
157
|
-
self.class.
|
155
|
+
def self_and_siblings
|
156
|
+
self.class.where(parent_id_field => self[parent_id_field]).order(tree_order)
|
157
|
+
|
158
158
|
end
|
159
159
|
|
160
|
-
def children
|
161
|
-
self.class.
|
160
|
+
def children
|
161
|
+
self.class.where(parent_id_field => self._id).order(tree_order)
|
162
162
|
end
|
163
163
|
|
164
164
|
private
|
@@ -288,7 +288,7 @@ module Noodall
|
|
288
288
|
end
|
289
289
|
|
290
290
|
def roots(options = {})
|
291
|
-
self.
|
291
|
+
self.where(parent_id_field => self._id).order(tree_order)
|
292
292
|
end
|
293
293
|
|
294
294
|
def find_by_permalink(permalink)
|
data/noodall-core.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noodall-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 23
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 2
|
9
|
+
- 0
|
10
|
+
version: 0.2.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|