Sha256: 1ca3f841fc931771f605e3ecc0b76c4362f9b019e441e0bad41fd7574812ff42

Contents?: true

Size: 573 Bytes

Versions: 42

Compression:

Stored size: 573 Bytes

Contents

module Locomotive
  module API
    module Entities

      class MembershipEntity < BaseEntity

        expose :role

        # render the BSON id
        expose :account_id do |membership, _|
          membership.account_id.to_s
        end

        expose :name do |membership, _|
          membership.account.name
        end

        expose :role_name do |membership, _|
          I18n.t("locomotive.memberships.roles.#{membership.role}")
        end

        expose :email do |membership, _|
          membership.account.email
        end

      end

    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

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