Sha256: c06846a68a0ff06ea7143f9041ca3ee764f4745bd30b6c2e7f51753f2087be4f

Contents?: true

Size: 462 Bytes

Versions: 42

Compression:

Stored size: 462 Bytes

Contents

module Locomotive
  module MembershipsHelper

    def options_for_membership_roles(membership)
      current_role = membership.role

      [].tap do |options|
        Locomotive::Membership::ROLES.each do |role|
          membership.role = role
          if policy(membership).change_role?
            options << [t("locomotive.memberships.roles.#{role}"), role.to_s]
          end
        end
        membership.role = current_role
      end
    end

  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
locomotivecms-4.2.0.alpha2 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.2.0.alpha1 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.1.1 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.1.0 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.1.0.rc1 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.3 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.2 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.1 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.0 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.0.rc0 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.0.alpha3 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.4.1 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.0.alpha2 app/helpers/locomotive/memberships_helper.rb
locomotivecms-4.0.0.alpha1 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.4.0 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.3.0 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.3.0.rc3 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.3.0.rc2 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.1.2 app/helpers/locomotive/memberships_helper.rb
locomotivecms-3.2.1 app/helpers/locomotive/memberships_helper.rb