Sha256: d8eca0bfbe69ad34c90872e5610dcfa3d21c0fefab19bc722a9dbe707370a3db

Contents?: true

Size: 377 Bytes

Versions: 6

Compression:

Stored size: 377 Bytes

Contents

module Yao
  module Resources
    module ProjectAssociationable

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

      # @return [Yao::Resources::Project]
      def project
        @project ||= Yao::Project.find(project_id || tenant_id)
      end

      alias :tenant :project
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yao-0.21.0 lib/yao/resources/project_associationable.rb
yao-0.20.0 lib/yao/resources/project_associationable.rb
yao-0.19.0 lib/yao/resources/project_associationable.rb
yao-0.18.0 lib/yao/resources/project_associationable.rb
yao-0.17.0 lib/yao/resources/project_associationable.rb
yao-0.16.0 lib/yao/resources/project_associationable.rb