Class: KDomain::Queries::DomainModelQuery

Inherits:
BaseQuery
  • Object
show all
Defined in:
lib/k_domain/queries/domain_model_query.rb

Overview

Query models found on the domain model by

has ruby file
has primary key
column count
data column count
foreign key column count
has timestamp (created_at, updated_at) columns
has created_at
has updated_at
has deleted_at
has polymorphic foreign keys
has virtual columns
virtual column filters (token, encrypted_password, etc)

Instance Attribute Summary

Attributes inherited from BaseQuery

#domain_model

Instance Method Summary collapse

Methods inherited from BaseQuery

#initialize

Constructor Details

This class inherits a constructor from KDomain::Queries::BaseQuery

Instance Method Details

#allObject



20
21
22
# File 'lib/k_domain/queries/domain_model_query.rb', line 20

def all
  domain_model.domain.models
end

#query(**filters) ⇒ Object



24
25
26
27
28
29
30
31
32
# File 'lib/k_domain/queries/domain_model_query.rb', line 24

def query(**filters)
  @query = all.clone

  filters.each do |key, value|
    send("filter_#{key}", value)
  end

  @query
end