Sha256: 735ba260b44d34198d52ece32fa9f15d3bab0fdd9fb260492d8c4b8b342af947
Contents?: true
Size: 641 Bytes
Versions: 23
Compression:
Stored size: 641 Bytes
Contents
RSpec.describe ROM::Relation, '#select_append' do subject(:relation) { relations[:tasks] } include_context 'users and tasks' with_adapters do it 'appends new columns' do selected = relation.select(:id).select_append(:title) expect(selected.schema.map(&:name)).to eql(%i[id title]) expect(selected.first).to eql(id: 1, title: "Joe's task") end it 'supports blocks' do selected = relation.select(:id).select_append { string::upper(title).as(:title) } expect(selected.schema.map(&:name)).to eql(%i[id title]) expect(selected.first).to eql(id: 1, title: "JOE'S TASK") end end end
Version data entries
23 entries across 23 versions & 1 rubygems