Sha256: a7a794c96d403e4a08a8ce62e8ca7ea732b3a60705fee4db896b9a3afb269507

Contents?: true

Size: 425 Bytes

Versions: 23

Compression:

Stored size: 425 Bytes

Contents

RSpec.describe ROM::Relation, '#distinct' do
  subject(:relation) { relations[:users] }

  include_context 'users and tasks'

  before do
    relation.insert id: 3, name: 'Jane'
  end

  with_adapters :postgres do
    it 'delegates to dataset and returns a new relation' do
      expect(relation.distinct(:name).order(:name).group(:name, :id).to_a).to eql([{ id: 1, name: 'Jane' }, { id: 2, name: 'Joe' }])
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
rom-sql-1.3.5 spec/unit/relation/distinct_spec.rb
rom-sql-1.3.4 spec/unit/relation/distinct_spec.rb
rom-sql-2.0.0.beta2 spec/unit/relation/distinct_spec.rb
rom-sql-2.0.0.beta1 spec/unit/relation/distinct_spec.rb
rom-sql-1.3.3 spec/unit/relation/distinct_spec.rb
rom-sql-1.3.2 spec/unit/relation/distinct_spec.rb
rom-sql-1.3.1 spec/unit/relation/distinct_spec.rb
rom-sql-1.3.0 spec/unit/relation/distinct_spec.rb
rom-sql-1.2.2 spec/unit/relation/distinct_spec.rb
rom-sql-1.2.1 spec/unit/relation/distinct_spec.rb
rom-sql-1.2.0 spec/unit/relation/distinct_spec.rb
rom-sql-1.1.2 spec/unit/relation/distinct_spec.rb
rom-sql-1.1.1 spec/unit/relation/distinct_spec.rb
rom-sql-1.1.0 spec/unit/relation/distinct_spec.rb
rom-sql-1.0.3 spec/unit/relation/distinct_spec.rb
rom-sql-1.0.2 spec/unit/relation/distinct_spec.rb
rom-sql-1.0.1 spec/unit/relation/distinct_spec.rb
rom-sql-1.0.0 spec/unit/relation/distinct_spec.rb
rom-sql-1.0.0.rc2 spec/unit/relation/distinct_spec.rb
rom-sql-1.0.0.rc1 spec/unit/relation/distinct_spec.rb