Module: Queryable::ActiveRecord
- Defined in:
- lib/queryable/active_record.rb
Constant Summary collapse
- DELEGATED_METHODS =
[ :average, :maximum, :minimum, :sum, :exists?, :find_by, :build, :create, :pluck, :entries, :new, :explain ]
- CHAINABLE_METHODS =
[ :where, :bind, :create_with, :distinct, :eager_load, :extending, :from, :group, :having, :includes, :joins, :limit, :lock, :none, :offset, :order, :preload, :readonly, :references, :reorder, :reverse_order, :select, :uniq, :not, :unscoped, :unscope, :only ]
Class Method Summary collapse
-
.included(base) ⇒ Object
Internal: Adds class methods, and default initialization.
Class Method Details
.included(base) ⇒ Object
Internal: Adds class methods, and default initialization.
23 24 25 26 27 28 |
# File 'lib/queryable/active_record.rb', line 23 def self.included(base) base.send(:include, Chainable, DefaultQuery, DefaultScope, ::Queryable) base.delegate *DELEGATED_METHODS base.delegate_and_chain *CHAINABLE_METHODS end |