Class: Georgia::Post

Inherits:
Page
  • Object
show all
Defined in:
app/models/georgia/post.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extra_search_paramsObject



63
64
65
66
67
68
69
# File 'app/models/georgia/post.rb', line 63

def extra_search_params
  Proc.new {
    facet :month, :tags
    with(:month, params[:m]) unless params[:m].blank?
    with(:tags, params[:c]) unless params[:t].blank?
  }
end

Instance Method Details

#monthObject



11
12
13
# File 'app/models/georgia/post.rb', line 11

def month
  @month ||= published_at.strftime('%B %Y') if published_at.present?
end

#yearObject



15
16
17
# File 'app/models/georgia/post.rb', line 15

def year
  @year ||= published_at.year if published_at.present?
end