Sha256: 2706e94a2eab2acc57c20cfe32f73681e142fac011aaa6d32d5e8c2d53317c19

Contents?: true

Size: 276 Bytes

Versions: 4

Compression:

Stored size: 276 Bytes

Contents

class PostsController < ApplicationController
  def show
    return not_found unless @post = Post.where("#{Post.extract_year('created_at')} = ? AND #{Post.extract_month('created_at')} = ? AND url = ?", params[:year], params[:month].rjust(2, '0'), params[:id]).first
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
grandstand-0.2.4 app/controllers/posts_controller.rb
grandstand-0.2.3 app/controllers/posts_controller.rb
grandstand-0.2.2 app/controllers/posts_controller.rb
grandstand-0.2.1 app/controllers/posts_controller.rb