Sha256: 2bf582e3a6281b864e8244382482d0ffbec0313699ec7d4dfcaa522eeb19451b

Contents?: true

Size: 373 Bytes

Versions: 7

Compression:

Stored size: 373 Bytes

Contents

module Plutus
  module Tenancy
    extend ActiveSupport::Concern

    included do
      validates :name, presence: true, uniqueness: { scope: :tenant_id }

      if ActiveRecord::VERSION::MAJOR > 4
        belongs_to :tenant, class_name: Plutus.tenant_class, optional: true
      else
        belongs_to :tenant, class_name: Plutus.tenant_class
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 3 rubygems

Version Path
plutus-0.17 app/models/plutus/tenancy.rb
plutus-0.16 app/models/plutus/tenancy.rb
plutus-0.15 app/models/plutus/tenancy.rb
plutus-0.14 app/models/plutus/tenancy.rb
tyche-0.14 app/models/plutus/tenancy.rb
odania_plutus-0.13 app/models/plutus/tenancy.rb
plutus-0.13 app/models/plutus/tenancy.rb