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 CHANGED
@@ -1 +1 @@
1
- 0.1.4
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
- # tree method that allow oprions to be passed
152
- def siblings(options = {})
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(options = {})
157
- self.class.all(options.merge(parent_id_field => self[parent_id_field], :order => tree_order))
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(options = {})
161
- self.class.all(options.merge(parent_id_field => self._id, :order => tree_order))
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.all(options.merge(parent_id_field => nil, :order => tree_order))
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{noodall-core}
8
- s.version = "0.1.4"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Steve England"]
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: 19
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 1
9
- - 4
10
- version: 0.1.4
8
+ - 2
9
+ - 0
10
+ version: 0.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve England