# File lib/active_record/relation/delegation.rb, line 10 10: def self.delegate_to_scoped_klass(method) 11: if method.to_s =~ /\A[a-zA-Z_]\w*[!?]?\z/ 12: module_eval def #{method}(*args, &block) scoping { @klass.#{method}(*args, &block) } end, __FILE__, __LINE__ + 1 13: else 14: module_eval def #{method}(*args, &block) scoping { @klass.send(#{method.inspect}, *args, &block) } end, __FILE__, __LINE__ + 1 15: end 16: end
# File lib/active_record/relation/delegation.rb, line 26 26: def respond_to?(method, include_private = false) 27: super || Array.method_defined?(method) || 28: @klass.respond_to?(method, include_private) || 29: arel.respond_to?(method, include_private) 30: end
# File lib/active_record/relation/delegation.rb, line 34 34: def method_missing(method, *args, &block) 35: if @klass.respond_to?(method) 36: ::ActiveRecord::Delegation.delegate_to_scoped_klass(method) 37: scoping { @klass.send(method, *args, &block) } 38: elsif Array.method_defined?(method) 39: ::ActiveRecord::Delegation.delegate method, :to => :to_a 40: to_a.send(method, *args, &block) 41: elsif arel.respond_to?(method) 42: ::ActiveRecord::Delegation.delegate method, :to => :arel 43: arel.send(method, *args, &block) 44: else 45: super 46: end 47: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.