Class: Almanac::Post

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/almanac/post.rb

Class Method Summary collapse

Class Method Details

.drafts(params) ⇒ Object



30
31
32
# File 'app/models/almanac/post.rb', line 30

def self.drafts(params)
  self.where(:published => false)
end

.recent(params) ⇒ Object



26
27
28
# File 'app/models/almanac/post.rb', line 26

def self.recent(params)
  self.where(:published => true).paginate(:page => posts_page(params), :per_page => posts_limit(params))
end

.tagged(params) ⇒ Object



34
35
36
# File 'app/models/almanac/post.rb', line 34

def self.tagged(params)
  self.where(:published => true).tagged_with(params[:tag_name]).paginate(:page => posts_page(params), :per_page => posts_limit(params))
end