aboutsummaryrefslogblamecommitdiffstats
path: root/activerecord/test/cases/associations/association_scope_test.rb
blob: 00e989153ff7f28b30d78987ea17580432e87877 (plain) (tree)
1
2
3
4
5
6
7
8
9

                             


                       



                                                       
                                             
                                                                              
                                                     
                                      



         
# frozen_string_literal: true

require "cases/helper"
require "models/post"
require "models/author"

module ActiveRecord
  module Associations
    class AssociationScopeTest < ActiveRecord::TestCase
      test "does not duplicate conditions" do
        scope = AssociationScope.scope(Author.new.association(:welcome_posts))
        binds = scope.where_clause.binds.map(&:value)
        assert_equal binds.uniq, binds
      end
    end
  end
end