instance method
respond_to?
Ruby on Rails 3.0.20
Since v3.0.20 Last seen in v3.1.12Available in: v3.0.20 v3.1.12
Signature
respond_to?(method, include_private = false)
No documentation comment.
Parameters
-
methodreq -
include_privateopt = false
Source
# File activerecord/lib/active_record/relation.rb, line 49
def respond_to?(method, include_private = false)
return true if arel.respond_to?(method, include_private) || Array.method_defined?(method) || @klass.respond_to?(method, include_private)
if match = DynamicFinderMatch.match(method)
return true if @klass.send(:all_attributes_exists?, match.attribute_names)
elsif match = DynamicScopeMatch.match(method)
return true if @klass.send(:all_attributes_exists?, match.attribute_names)
else
super
end
end
Defined in activerecord/lib/active_record/relation.rb line 49
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::Relation