Sha256: 0f3828184b73f678d220fa669bdd7b22e920d884edb79527d8309d6610e6716b

Contents?: true

Size: 331 Bytes

Versions: 15

Compression:

Stored size: 331 Bytes

Contents

module Yao
  module Resources
    module TenantAssociationable

      def self.included(base)
        base.friendly_attributes :project_id
        base.friendly_attributes :tenant_id
      end

      def tenant
        @tenant ||= Yao::Tenant.find(project_id || tenant_id)
      end

      alias :project :tenant
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
yao-0.13.4 lib/yao/resources/tenant_associationable.rb
yao-0.13.3 lib/yao/resources/tenant_associationable.rb
yao-0.13.2 lib/yao/resources/tenant_associationable.rb
yao-0.13.1 lib/yao/resources/tenant_associationable.rb
yao-0.13.0 lib/yao/resources/tenant_associationable.rb
yao-0.12.0 lib/yao/resources/tenant_associationable.rb
yao-0.11.3 lib/yao/resources/tenant_associationable.rb
yao-0.11.2 lib/yao/resources/tenant_associationable.rb
yao-0.11.1 lib/yao/resources/tenant_associationable.rb
yao-0.11.0 lib/yao/resources/tenant_associationable.rb
yao-0.10.1 lib/yao/resources/tenant_associationable.rb
yao-0.10.0 lib/yao/resources/tenant_associationable.rb
yao-0.9.1 lib/yao/resources/tenant_associationable.rb
yao-0.9.0 lib/yao/resources/tenant_associationable.rb
yao-0.8.0 lib/yao/resources/tenant_associationable.rb