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.11.0 app/helpers/invitation_only_helper.rb
bullet_train-1.10.0 app/helpers/invitation_only_helper.rb
bullet_train-1.9.0 app/helpers/invitation_only_helper.rb
bullet_train-1.8.5 app/helpers/invitation_only_helper.rb
bullet_train-1.8.4 app/helpers/invitation_only_helper.rb
bullet_train-1.8.3 app/helpers/invitation_only_helper.rb
bullet_train-1.8.2 app/helpers/invitation_only_helper.rb
bullet_train-1.8.1 app/helpers/invitation_only_helper.rb
bullet_train-1.8.0 app/helpers/invitation_only_helper.rb
bullet_train-1.7.23 app/helpers/invitation_only_helper.rb
bullet_train-1.7.22 app/helpers/invitation_only_helper.rb
bullet_train-1.7.21 app/helpers/invitation_only_helper.rb
bullet_train-1.7.20 app/helpers/invitation_only_helper.rb
bullet_train-1.7.19 app/helpers/invitation_only_helper.rb
bullet_train-1.7.18 app/helpers/invitation_only_helper.rb
bullet_train-1.7.17 app/helpers/invitation_only_helper.rb
bullet_train-1.7.16 app/helpers/invitation_only_helper.rb
bullet_train-1.7.15 app/helpers/invitation_only_helper.rb
bullet_train-1.7.14 app/helpers/invitation_only_helper.rb
bullet_train-1.7.13 app/helpers/invitation_only_helper.rb