noodall-core 0.1.3 → 0.1.4

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.3
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, :message => "cannot be changed as sub content is not allowed in this template", :logic => lambda { children.reject{|c| self._type.constantize.template_classes.include?(c.class)}.empty? }
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
@@ -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.3"
8
+ s.version = "0.1.4"
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"]
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.all(:published_at => { :$lte => Time.now }, :published_to => { :$gte => Time.now })
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: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 3
10
- version: 0.1.3
9
+ - 4
10
+ version: 0.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Steve England