Sha256: efde4a7e83d5379106258caf223839c2d7cca77de813e7ca9fd0c74f879749ff

Contents?: true

Size: 759 Bytes

Versions: 5

Compression:

Stored size: 759 Bytes

Contents

require 'commontator/shared_helper'
require 'commontator/security_transgression'

module Commontator
  module ControllerIncludes
    def self.included(base)
      base.helper Commontator::SharedHelper
    end
    
    protected
    
    def commontator_thread_show(commontable)
      user = Commontator.current_user_proc.call(self)	
      thread = commontable.thread
      raise SecurityTransgression unless thread.can_be_read_by?(user)
      thread.mark_as_read_for(user)
      @commontator_page = params[:page] || 1
      @commontator_per_page = params[:per_page] ||\
                              thread.config.comments_per_page
      @commontator_thread_show = true
    end
  end
end

ActionController::Base.send :include, Commontator::ControllerIncludes

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
commontator-4.5.4 lib/commontator/controller_includes.rb
commontator-4.5.3 lib/commontator/controller_includes.rb
commontator-4.5.2 lib/commontator/controller_includes.rb
commontator-4.5.1 lib/commontator/controller_includes.rb
commontator-4.5.0 lib/commontator/controller_includes.rb