Sha256: e81dfa84b8fe8e361d3cc9b48b52eccee1f5219372a3e7942295db8f61dad180

Contents?: true

Size: 636 Bytes

Versions: 3

Compression:

Stored size: 636 Bytes

Contents

require 'commontator/shared_helper'

module Commontator
  module ControllerIncludes
    def self.included(base)
      base.helper Commontator::SharedHelper
    end
    
    protected
    
    def commontator_thread_show(commontable)
      user = send Commontator.current_user_method	
      raise SecurityTransgression unless (@user.nil? || @user.is_commontator)
      
      thread = commontable.thread
      raise SecurityTransgression unless thread.can_be_read_by?(user)
      thread.mark_as_read_for(user)
      @commontator_thread_show = true
    end
  end
end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
commontator-0.5.14 lib/commontator/controller_includes.rb~
commontator-0.5.13 lib/commontator/controller_includes.rb~
commontator-0.5.12 lib/commontator/controller_includes.rb~