提交 683df716 编写于 作者: R Rafael Mendonça França

Move the parameter normalization to the initialize method

activerecord-deprecated_finders expects the parameters denormalized in
its initialize method
上级 7a036ebd
......@@ -37,15 +37,16 @@ def self.build(model, name, scope, options, &block)
def self.create_builder(model, name, scope, options, &block)
raise ArgumentError, "association names must be a Symbol" unless name.kind_of?(Symbol)
new(model, name, scope, options, &block)
end
def initialize(model, name, scope, options)
# TODO: Move this to create_builder as soon we drop support to activerecord-deprecated_finders.
if scope.is_a?(Hash)
options = scope
scope = nil
end
new(model, name, scope, options, &block)
end
def initialize(model, name, scope, options)
# TODO: Remove this model argument as soon we drop support to activerecord-deprecated_finders.
@name = name
@scope = scope
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册