Class: ActiveHouse::Query

Inherits:
Object
  • Object
show all
Includes:
Chainable, Collectable, Scopeable
Defined in:
lib/active_house/query.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Scopeable

#method_missing, #respond_to_missing?

Methods included from Collectable

#loaded?, #reset, #to_a, #to_hashes

Methods included from Chainable

#chain_defaults, #chain_methods, #dup, #except, #to_query

Methods included from ArrayJoinable

#array_join

Methods included from Unionable

#except_union, #union, #union_for, #update_union

Methods included from Limitable

#limit

Methods included from Havingable

#having

Methods included from Groupable

#group_by

Methods included from Orderable

#order_by

Methods included from Whereable

#where

Methods included from Fromable

#from

Methods included from Selectable

#select

Constructor Details

#initialize(model_class = ActiveHouse::Model) ⇒ Query

Returns a new instance of Query.



9
10
11
12
# File 'lib/active_house/query.rb', line 9

def initialize(model_class = ActiveHouse::Model)
  @model_class = model_class
  super()
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class ActiveHouse::Scopeable

Instance Attribute Details

#model_classObject (readonly)

Returns the value of attribute model_class.



7
8
9
# File 'lib/active_house/query.rb', line 7

def model_class
  @model_class
end

Instance Method Details

#connectionObject



14
15
16
# File 'lib/active_house/query.rb', line 14

def connection
  model_class.connection
end