Module: ActiveRecord::Delegation
- Extended by:
- ActiveSupport::Concern
- Included in:
- Relation
- Defined in:
- lib/active_record/relation/delegation.rb
Overview
:nodoc:
Defined Under Namespace
Modules: ClassMethods, ClassSpecificRelation, DelegateCache
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (protected)
120 121 122 123 124 125 126 127 128 |
# File 'lib/active_record/relation/delegation.rb', line 120 def method_missing(method, *args, &block) if @klass.respond_to?(method) scoping { @klass.public_send(method, *args, &block) } elsif arel.respond_to?(method) arel.public_send(method, *args, &block) else super end end |
Instance Method Details
#respond_to?(method, include_private = false) ⇒ Boolean
113 114 115 116 |
# File 'lib/active_record/relation/delegation.rb', line 113 def respond_to?(method, include_private = false) super || @klass.respond_to?(method, include_private) || arel.respond_to?(method, include_private) end |