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.
Files changed (3) hide show
  1. data/app/models/news_item.rb +6 -2
  2. data/lib/news.rb +1 -1
  3. metadata +4 -4
@@ -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 :latest, lambda { |*limit| { :conditions => ["publish_date < ?", Time.now], :limit => (limit.first || 10) } }
15
- scope :published, lambda { { :conditions => ["publish_date < ?", Time.now] } }
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
@@ -2,7 +2,7 @@ module Refinery
2
2
  module News
3
3
  class << self
4
4
  def version
5
- %q{0.9.9.1}
5
+ %q{0.9.9.2}
6
6
  end
7
7
  end
8
8
  end
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: 33
4
+ hash: 39
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 9
10
- - 1
11
- version: 0.9.9.1
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-16 00:00:00 +12:00
19
+ date: 2010-09-20 00:00:00 +12:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency