Sha256: 9e495b16f05af4ff8ce6b957e3e076e9f27e40841422c5e1252098dc9e36f0a5

Contents?: true

Size: 685 Bytes

Versions: 12

Compression:

Stored size: 685 Bytes

Contents

require 'commontator/shared_helper'

module Commontator
  module SharedMethods
    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::SharedMethods
ActionMailer::Base.send :include, Commontator::SharedMethods

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
commontator-1.1.1 lib/commontator/shared_methods.rb~
commontator-1.1.0 lib/commontator/shared_methods.rb~
commontator-1.0.6 lib/commontator/shared_methods.rb~
commontator-1.0.5 lib/commontator/shared_methods.rb~
commontator-1.0.4 lib/commontator/shared_methods.rb~
commontator-1.0.3 lib/commontator/shared_methods.rb~
commontator-1.0.2 lib/commontator/shared_methods.rb~
commontator-1.0.1 lib/commontator/shared_methods.rb~
commontator-1.0.0 lib/commontator/shared_methods.rb~
commontator-0.5.14 lib/commontator/shared_methods.rb~
commontator-0.5.13 lib/commontator/shared_methods.rb~
commontator-0.5.12 lib/commontator/shared_methods.rb~