提交 3c27b6ee 编写于 作者: R Rafael Mendonça França

Make validate_options a class method

上级 b83f3645
......@@ -45,7 +45,7 @@ def initialize(name, scope, options, extension)
@scope = scope
@options = options
validate_options
self.class.validate_options(options)
if scope && scope.arity == 0
@scope = proc { instance_exec(&scope) }
......@@ -64,8 +64,8 @@ def self.valid_options(options)
VALID_OPTIONS + Association.extensions.flat_map(&:valid_options)
end
def validate_options
options.assert_valid_keys(self.class.valid_options(options))
def self.validate_options(options)
options.assert_valid_keys(valid_options(options))
end
def self.define_extensions(model, name)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册