Sha256: abdab0d7fb632d4d1e73d3d6653517bcbd5815a10c0fac2eeb2e5c468cf4f186

Contents?: true

Size: 969 Bytes

Versions: 7

Compression:

Stored size: 969 Bytes

Contents

require_relative 'concerns/all'
require 'activerecord-multi-tenant'

module Hippo

    class Model < ::ActiveRecord::Base
        self.abstract_class = true

        include Concerns::PubSub
        include Concerns::ApiAttributeAccess
        include Concerns::ExportMethods
        include Concerns::ExportScope
        include Concerns::ExportAssociations
        include Concerns::ExportJoinTables
        include Concerns::AssociationExtensions
        include Concerns::ApiPath
        include Concerns::CodeIdentifier
        include Concerns::SanitizeFields
        include Concerns::Queries
        include Concerns::SortingExpressions
        include Concerns::RandomIdentifer

        def self.belongs_to_tenant
            belongs_to :tenant, class_name: 'Hippo::Tenant'
            multi_tenant :tenant
        end

        # will be overridden if models call belongs_to_tenant
        def self.scoped_by_tenant?
            false
        end
    end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hippo-fw-0.9.8 lib/hippo/model.rb
hippo-fw-0.9.7 lib/hippo/model.rb
hippo-fw-0.9.6 lib/hippo/model.rb
hippo-fw-0.9.5 lib/hippo/model.rb
hippo-fw-0.9.4 lib/hippo/model.rb
hippo-fw-0.9.3 lib/hippo/model.rb
hippo-fw-0.9.2 lib/hippo/model.rb