refinerycms-news 0.9.9.1 → 0.9.9.2
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/app/models/news_item.rb +6 -2
- data/lib/news.rb +1 -1
- metadata +4 -4
data/app/models/news_item.rb
CHANGED
@@ -11,8 +11,12 @@ class NewsItem < ActiveRecord::Base
|
|
11
11
|
|
12
12
|
# If you're using a named scope that includes a changing variable you need to wrap it in a lambda
|
13
13
|
# This avoids the query being cached thus becoming unaffected by changes (i.e. Time.now is constant)
|
14
|
-
scope :
|
15
|
-
|
14
|
+
scope :published, lambda {
|
15
|
+
where( "publish_date < ?", Time.now )
|
16
|
+
}
|
17
|
+
scope :latest, lambda { |*l_params|
|
18
|
+
published.limit( l_params.first || 10)
|
19
|
+
}
|
16
20
|
|
17
21
|
def not_published? # has the published date not yet arrived?
|
18
22
|
publish_date > Time.now
|
data/lib/news.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-news
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 39
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 9
|
10
|
-
-
|
11
|
-
version: 0.9.9.
|
10
|
+
- 2
|
11
|
+
version: 0.9.9.2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Resolve Digital
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-09-
|
19
|
+
date: 2010-09-20 00:00:00 +12:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|