Sha256: 6786a962d43b4350709e46bd5b122d03d95c3a1373d44449c37aacc2c7ec2d03

Contents?: true

Size: 584 Bytes

Versions: 35

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

require "spec_helper"
require_relative '../has_many_models'

describe Mongoid::Association::Referenced::HasMany::Proxy do
  context 'with primary_key and foreign_key given' do
    let(:company) { HmmCompany.create!(p: 123) }
    let(:criteria) { company.emails }

    it 'generates correct query' do
      expect(criteria.selector).to eq('f' => 123)
    end

    context 'unscoped' do
      let(:criteria) { company.emails.unscoped }

      it 'generates correct query' do
        expect(criteria.selector).to eq('f' => 123)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
mongoid-8.1.8 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.7 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.6 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.8 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.5 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.4 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.7 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.3 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.2 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.6 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-7.5.4 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.1 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.5 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.1.0 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-7.5.3 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.4 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.3 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-7.5.2 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-8.0.2 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb
mongoid-7.5.1 spec/mongoid/association/referenced/has_many/proxy_query_spec.rb