Sha256: f7c14c1123f80cf34e48ac1f32e907a6046a0cd6cf556f563dc21ebb7dde8081

Contents?: true

Size: 636 Bytes

Versions: 3

Compression:

Stored size: 636 Bytes

Contents

module Commontator
  class ApplicationController < ActionController::Base
    before_filter :get_user
    
    protected
    
    def get_user
      @user = send Commontator.current_user_method	
      raise SecurityTransgression unless (@user.nil? || @user.is_commontator)
    end
    
    def get_thread
      @thread = params[:thread_id].blank? ? \
        Commontator::Thread.find(params[:id]) : \
        Commontator::Thread.find(params[:thread_id])
      get_commontable_url
    end
    
    def get_commontable_url
      @commontable_url = @thread.config.commontable_url_proc.call(main_app, @thread.commontable)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
commontator-0.5.14 app/controllers/commontator/application_controller.rb~
commontator-0.5.13 app/controllers/commontator/application_controller.rb~
commontator-0.5.12 app/controllers/commontator/application_controller.rb~