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
24 25 26 |
# File 'app/models/cmtool/news.rb', line 24 def self.active( = {till: Date.today}) find_all_by_active(true, ) end |
.find_all_by_active(active, options = {till: Date.today}) ⇒ Object
28 29 30 |
# File 'app/models/cmtool/news.rb', line 28 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 |