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

check bind parameter uniqueness

上级 9b5d603c
......@@ -7,8 +7,13 @@ module Associations
class AssociationScopeTest < ActiveRecord::TestCase
test 'does not duplicate conditions' do
association_scope = AssociationScope.new(Author.new.association(:welcome_posts))
wheres = association_scope.scope.where_values.map(&:right)
scope = association_scope.scope
binds = scope.bind_values.map(&:last)
wheres = scope.where_values.map(&:right).reject { |node|
Arel::Nodes::BindParam === node
}
assert_equal wheres.uniq, wheres
assert_equal binds.uniq, binds
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册