method
method_missing
v2.3.8 -
Show latest stable
- Class:
ActiveRecord::NamedScope::Scope
method_missing(method, *args, &block)private
No documentation available.
# File activerecord/lib/active_record/named_scope.rb, line 170
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