Class: Cmtool::News
- Inherits:
-
Object
- Object
- Cmtool::News
- Includes:
- Paperclip::Glue, SimplyStored::Couch
- Defined in:
- app/models/cmtool/news.rb
Class Method Summary collapse
- .active(options = {till: Date.today}) ⇒ Object
- .find_all_by_active(active, options = {till: Date.today}) ⇒ Object
Class Method Details
.active(options = {till: Date.today}) ⇒ Object
27 28 29 |
# File 'app/models/cmtool/news.rb', line 27 def self.active( = {till: Date.today}) find_all_by_active(true, ) end |
.find_all_by_active(active, options = {till: Date.today}) ⇒ Object
31 32 33 |
# File 'app/models/cmtool/news.rb', line 31 def self.find_all_by_active(active, = {till: Date.today}) database.view(by_active(startkey: [active, [:till].strftime('%Y-%m-%d')], endkey: [active], descending: true)) end |