beef-acts_as_content_node 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 CHANGED
@@ -1 +1 @@
1
- 0.1.3
1
+ 0.1.4
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{acts_as_content_node}
5
- s.version = "0.1.3"
5
+ s.version = "0.1.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Steve England"]
9
- s.date = %q{2009-07-29}
9
+ s.date = %q{2009-08-28}
10
10
  s.email = %q{steve@wearebeef.co.uk}
11
11
  s.extra_rdoc_files = [
12
12
  "LICENSE",
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
50
50
  s.homepage = %q{http://github.com/beef/acts_as_content_node}
51
51
  s.rdoc_options = ["--charset=UTF-8"]
52
52
  s.require_paths = ["lib"]
53
- s.rubygems_version = %q{1.3.3}
53
+ s.rubygems_version = %q{1.3.5}
54
54
  s.summary = %q{Common functions for an record used as content of a website. Generator for cms and front end}
55
55
  s.test_files = [
56
56
  "test/acts_as_content_node_test.rb",
@@ -5,7 +5,7 @@ module Beef
5
5
  def acts_as_publishable
6
6
  send :include, InstanceMethods
7
7
 
8
- named_scope :published, lambda { { :conditions => ['published_at != \'\' AND published_at < ? AND (published_to > ? OR published_to is null)', Time.zone.now, Time.zone.now] } }
8
+ named_scope :published, lambda { { :conditions => ["(published_at IS NOT NULL AND published_at != '') AND published_at < ? AND (published_to > ? OR published_to IS NULL OR published_to = '')", Time.now, Time.now] } }
9
9
 
10
10
  before_save :set_published
11
11
 
@@ -82,10 +82,14 @@ class ContentNodeTest < Test::Unit::TestCase
82
82
  @content_node = Factory(:content_node, :publish => true)
83
83
  end
84
84
 
85
- should "be based published" do
85
+ should "be published" do
86
86
  assert @content_node.published?
87
87
  end
88
88
 
89
+ should "be found in published scope" do
90
+ assert !ContentNode.published.find(@content_node.id).nil?
91
+ end
92
+
89
93
  should "not be published if updated and hide set" do
90
94
  @content_node.update_attributes(:hide => true)
91
95
  assert !@content_node.published?
data/test/database.yml CHANGED
@@ -16,6 +16,6 @@ postgresql:
16
16
  mysql:
17
17
  :adapter: mysql
18
18
  :host: localhost
19
- :username: rails
19
+ :username: root
20
20
  :password:
21
21
  :database: acts_as_content_node_plugin_test
data/test/test_helper.rb CHANGED
@@ -15,6 +15,7 @@ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
15
15
  $LOAD_PATH.unshift(File.dirname(__FILE__))
16
16
 
17
17
  RAILS_DEFAULT_LOGGER = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))
18
+ ActiveRecord::Base.logger = RAILS_DEFAULT_LOGGER
18
19
 
19
20
  require "acts_as_content_node/content_node"
20
21
  require "acts_as_content_node/publishable"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beef-acts_as_content_node
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve England
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-07-29 00:00:00 -07:00
12
+ date: 2009-08-28 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -58,7 +58,6 @@ files:
58
58
  - test/test_helper.rb
59
59
  has_rdoc: false
60
60
  homepage: http://github.com/beef/acts_as_content_node
61
- licenses:
62
61
  post_install_message:
63
62
  rdoc_options:
64
63
  - --charset=UTF-8
@@ -79,7 +78,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
79
78
  requirements: []
80
79
 
81
80
  rubyforge_project:
82
- rubygems_version: 1.3.5
81
+ rubygems_version: 1.2.0
83
82
  signing_key:
84
83
  specification_version: 3
85
84
  summary: Common functions for an record used as content of a website. Generator for cms and front end