提交 b3bc3aa5 编写于 作者: A Aaron Patterson

sometimes singularize does not work, so we get a list of two strings. just uniq them

上级 9e7040d8
......@@ -635,7 +635,7 @@ def association_primary_key(klass = nil)
# # => [:tag, :tags]
#
def source_reflection_names
@source_reflection_names ||= (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym }
@source_reflection_names ||= (options[:source] ? [options[:source]] : [name.to_s.singularize, name]).collect { |n| n.to_sym }.uniq
end
def source_options
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册