beef-articles 0.4.17 → 0.4.18
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/app/models/article.rb +9 -9
- data/app/models/comment.rb +1 -1
- data/beef-articles.gemspec +6 -6
- data/test/test_helper.rb +2 -0
- metadata +5 -14
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.18
|
data/app/models/article.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
class Article < ActiveRecord::Base
|
2
2
|
belongs_to :category
|
3
|
-
|
3
|
+
|
4
4
|
acts_as_content_node
|
5
5
|
acts_as_commentable
|
6
6
|
has_assets
|
7
|
-
acts_as_textiled :body
|
7
|
+
acts_as_textiled :body if respond_to?(:acts_as_textiled)
|
8
8
|
acts_as_taggable_on :tags
|
9
|
-
|
9
|
+
|
10
10
|
named_scope :categorised, lambda { |category|
|
11
11
|
return {} if category.nil?
|
12
12
|
category = Category.find(category) unless category.nil? or category.is_a? Category
|
13
13
|
{ :conditions => { :category_id => category.id } }
|
14
14
|
}
|
15
|
-
|
15
|
+
|
16
16
|
named_scope :in_time_delta, lambda { |year, month, day|
|
17
17
|
return {} if year.blank?
|
18
18
|
from = Time.mktime(year, month || 1, day || 1)
|
@@ -22,15 +22,15 @@ class Article < ActiveRecord::Base
|
|
22
22
|
to = to.tomorrow unless month.blank?
|
23
23
|
{ :conditions => ['published_at BETWEEN ? AND ?', from, to ] }
|
24
24
|
}
|
25
|
-
|
25
|
+
|
26
26
|
default_scope :order => 'published_at DESC'
|
27
|
-
|
27
|
+
|
28
28
|
validates_presence_of :body, :description, :tag_list, :if => :publish
|
29
|
-
|
29
|
+
|
30
30
|
# Default per page options
|
31
31
|
cattr_accessor :per_page
|
32
32
|
@@per_page = 10
|
33
|
-
|
33
|
+
|
34
34
|
# Finds one article which was posted on a certain date and matches the supplied dashed-title
|
35
35
|
def self.find_by_permalink(year, month, day, permalink)
|
36
36
|
if result = in_time_delta(year, month, day).first( :conditions => ["permalink = ?", permalink] )
|
@@ -39,5 +39,5 @@ class Article < ActiveRecord::Base
|
|
39
39
|
raise ActiveRecord::RecordNotFound, "Couldn't find article with permalink #{permalink} on #{year}.#{month}.#{day}}"
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
end
|
data/app/models/comment.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class Comment < ActiveRecord::Base
|
2
2
|
belongs_to :commentable, :polymorphic => true
|
3
3
|
|
4
|
-
acts_as_textiled :body => [:hard_breaks, :filter_html, :filter_styles]
|
4
|
+
acts_as_textiled :body => [:hard_breaks, :filter_html, :filter_styles] if respond_to?(:acts_as_textiled)
|
5
5
|
|
6
6
|
validates_presence_of :name, :comment
|
7
7
|
validates_acceptance_of :spam_filter, :accept => true, :on => :create, :allow_nil => false, :message => "believes message to be spam."
|
data/beef-articles.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{beef-articles}
|
8
|
-
s.version = "0.4.
|
8
|
+
s.version = "0.4.18"
|
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"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-07-02}
|
13
13
|
s.email = %q{steve@wearebeef.co.uk}
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE",
|
@@ -60,19 +60,19 @@ Gem::Specification.new do |s|
|
|
60
60
|
s.homepage = %q{http://github.com/beef/articles}
|
61
61
|
s.rdoc_options = ["--charset=UTF-8"]
|
62
62
|
s.require_paths = ["lib"]
|
63
|
-
s.rubygems_version = %q{1.3.
|
63
|
+
s.rubygems_version = %q{1.3.6}
|
64
64
|
s.summary = %q{Article/Blogging engine}
|
65
65
|
s.test_files = [
|
66
66
|
"test/articles_test.rb",
|
67
|
-
"test/
|
68
|
-
"test/
|
67
|
+
"test/schema.rb",
|
68
|
+
"test/test_helper.rb"
|
69
69
|
]
|
70
70
|
|
71
71
|
if s.respond_to? :specification_version then
|
72
72
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
73
73
|
s.specification_version = 3
|
74
74
|
|
75
|
-
if Gem::Version.new(Gem::
|
75
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
76
76
|
s.add_runtime_dependency(%q<mbleigh-acts-as-taggable-on>, [">= 0"])
|
77
77
|
s.add_runtime_dependency(%q<jackdempsey-acts_as_commentable>, [">= 0"])
|
78
78
|
else
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beef-articles
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 45
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 0
|
8
7
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
8
|
+
- 18
|
9
|
+
version: 0.4.18
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Steve England
|
@@ -15,18 +14,16 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-07-02 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: mbleigh-acts-as-taggable-on
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
25
|
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 3
|
30
27
|
segments:
|
31
28
|
- 0
|
32
29
|
version: "0"
|
@@ -36,11 +33,9 @@ dependencies:
|
|
36
33
|
name: jackdempsey-acts_as_commentable
|
37
34
|
prerelease: false
|
38
35
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
-
none: false
|
40
36
|
requirements:
|
41
37
|
- - ">="
|
42
38
|
- !ruby/object:Gem::Version
|
43
|
-
hash: 3
|
44
39
|
segments:
|
45
40
|
- 0
|
46
41
|
version: "0"
|
@@ -106,31 +101,27 @@ rdoc_options:
|
|
106
101
|
require_paths:
|
107
102
|
- lib
|
108
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|
109
|
-
none: false
|
110
104
|
requirements:
|
111
105
|
- - ">="
|
112
106
|
- !ruby/object:Gem::Version
|
113
|
-
hash: 3
|
114
107
|
segments:
|
115
108
|
- 0
|
116
109
|
version: "0"
|
117
110
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
-
none: false
|
119
111
|
requirements:
|
120
112
|
- - ">="
|
121
113
|
- !ruby/object:Gem::Version
|
122
|
-
hash: 3
|
123
114
|
segments:
|
124
115
|
- 0
|
125
116
|
version: "0"
|
126
117
|
requirements: []
|
127
118
|
|
128
119
|
rubyforge_project:
|
129
|
-
rubygems_version: 1.3.
|
120
|
+
rubygems_version: 1.3.6
|
130
121
|
signing_key:
|
131
122
|
specification_version: 3
|
132
123
|
summary: Article/Blogging engine
|
133
124
|
test_files:
|
134
125
|
- test/articles_test.rb
|
135
|
-
- test/test_helper.rb
|
136
126
|
- test/schema.rb
|
127
|
+
- test/test_helper.rb
|