instance method
method_missing
Ruby on Rails 2.3.18
Since v2.2.3 Last seen in v2.3.18 PrivateAvailable in: v2.2.3 v2.3.18
Signature
method_missing(method, *args, &block)
No documentation comment.
Parameters
-
methodreq -
argsrest -
blockblock
Source
# File activerecord/lib/active_record/named_scope.rb, line 175
def method_missing(method, *args, &block)
if scopes.include?(method)
scopes[method].call(self, *args)
else
with_scope({:find => proxy_options, :create => proxy_options[:conditions].is_a?(Hash) ? proxy_options[:conditions] : {}}, :reverse_merge) do
method = :new if method == :build
if current_scoped_methods_when_defined && !scoped_methods.include?(current_scoped_methods_when_defined)
with_scope current_scoped_methods_when_defined do
proxy_scope.send(method, *args, &block)
end
else
proxy_scope.send(method, *args, &block)
end
end
end
end
Defined in activerecord/lib/active_record/named_scope.rb line 175
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveRecord::NamedScope::Scope