Sha256: 43f0032ee8fcdab8f351e7b89c701f57b09785f157cda39217f72e3e1f13133f

Contents?: true

Size: 837 Bytes

Versions: 7

Compression:

Stored size: 837 Bytes

Contents

module Character::InstanceConcern
  extend ActiveSupport::Concern

  included do
    before_filter :set_instance_name
  end

  private

  def set_instance_name
    @character_instance_name ||= (/\/([^\/&]+)/.match request.path)[1]
  end

  def character_instance
    @character_instance ||= begin
      Character.instances[@character_instance_name]
    end
  end

  def browserid_config
    @browserid_config ||= begin
      config = Rails.configuration.browserid.clone
      config.user_model       = character_instance.user_model
      config.session_variable = "#{ character_instance.name }_browserid_email"
      config.login.text       = 'Sign-in with Persona'
      config.login.path       = "/#{ character_instance.name }/login"
      config.logout.path      = "/#{ character_instance.name }/logout"
      config
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
character-1.0.6 app/controllers/concerns/character/instance_concern.rb
character-1.0.5 app/controllers/concerns/character/instance_concern.rb
character-1.0.4 app/controllers/concerns/character/instance_concern.rb
character-1.0.3 app/controllers/concerns/character/instance_concern.rb
character-1.0.2 app/controllers/concerns/character/instance_concern.rb
character-1.0.1 app/controllers/concerns/character/instance_concern.rb
character-1.0.0 app/controllers/concerns/character/instance_concern.rb