dhoss/Kodiak

View on GitHub
app/controllers/application_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ApplicationController < ActionController::Base
  protect_from_forgery

  before_filter :archives_section, :recent_activity, :categories_section

  def archives_section
    @year_month_pairs = Post.year_month_pairs
  end

  def recent_activity
    @recent_posts  = Post.published.order(published_on: :desc).limit(5)
  end

  def categories_section
    @categories_section = Category.order(created_at: :desc).all
  end
end