Sha256: 268ae4d4930d6c61e1c21342bb35683bd7c2d56075d1152ce2f9c5756d542c16

Contents?: true

Size: 394 Bytes

Versions: 108

Compression:

Stored size: 394 Bytes

Contents

require "active_support/security_utils"

module InvitationOnlyHelper
  def invited?
    return false unless session[:invitation_key].present?

    result = invitation_keys.find do |key|
      ActiveSupport::SecurityUtils.secure_compare(key, session[:invitation_key])
    end

    result.present?
  end

  def show_sign_up_options?
    return true unless invitation_only?
    invited?
  end
end

Version data entries

108 entries across 108 versions & 1 rubygems

Version Path
bullet_train-1.6.6 app/helpers/invitation_only_helper.rb
bullet_train-1.6.5 app/helpers/invitation_only_helper.rb
bullet_train-1.6.4 app/helpers/invitation_only_helper.rb
bullet_train-1.6.3 app/helpers/invitation_only_helper.rb
bullet_train-1.6.2 app/helpers/invitation_only_helper.rb
bullet_train-1.6.1 app/helpers/invitation_only_helper.rb
bullet_train-1.6.0 app/helpers/invitation_only_helper.rb
bullet_train-1.5.2 app/helpers/invitation_only_helper.rb
bullet_train-1.5.1 app/helpers/invitation_only_helper.rb
bullet_train-1.5.0 app/helpers/invitation_only_helper.rb
bullet_train-1.4.11 app/helpers/invitation_only_helper.rb
bullet_train-1.4.10 app/helpers/invitation_only_helper.rb
bullet_train-1.4.9 app/helpers/invitation_only_helper.rb
bullet_train-1.4.8 app/helpers/invitation_only_helper.rb
bullet_train-1.4.7 app/helpers/invitation_only_helper.rb
bullet_train-1.4.6 app/helpers/invitation_only_helper.rb
bullet_train-1.4.5 app/helpers/invitation_only_helper.rb
bullet_train-1.4.4 app/helpers/invitation_only_helper.rb
bullet_train-1.4.3 app/helpers/invitation_only_helper.rb
bullet_train-1.4.2 app/helpers/invitation_only_helper.rb