noodall-core 0.1.3 → 0.1.4
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.
- data/VERSION +1 -1
- data/lib/noodall/node.rb +5 -1
- data/noodall-core.gemspec +1 -1
- data/spec/node_spec.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.4
|
data/lib/noodall/node.rb
CHANGED
@@ -35,7 +35,11 @@ module Noodall
|
|
35
35
|
|
36
36
|
searchable_keys :title, :description, :keywords, :body
|
37
37
|
|
38
|
-
validates_true_for :template,
|
38
|
+
validates_true_for :template,
|
39
|
+
:message => "cannot be changed as sub content is not allowed in this template",
|
40
|
+
:logic => lambda { children.reject{|c| self._type.constantize.template_classes.include?(c.class)}.empty? }
|
41
|
+
|
42
|
+
scope :published, lambda { where(:published_at => { :$lte => current_time }, :published_to => { :$gte => current_time }) }
|
39
43
|
|
40
44
|
def published_children
|
41
45
|
self.children.select{|c| c.published? }
|
data/noodall-core.gemspec
CHANGED
data/spec/node_spec.rb
CHANGED
@@ -142,7 +142,7 @@ describe Noodall::Node do
|
|
142
142
|
end
|
143
143
|
|
144
144
|
it "should be findable by publish dates" do
|
145
|
-
nodes = Noodall::Node.
|
145
|
+
nodes = Noodall::Node.published
|
146
146
|
nodes.should have(1).things
|
147
147
|
|
148
148
|
nodes = Noodall::Node.all(:published_at => { :$lte => 4.days.ago }, :published_to => { :$gte => 4.days.ago })
|
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: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|