Sha256: d56faa1a8e18840ec6539e1be41b563a9e7db5bc818058fc40a6346312620c9d
Contents?: true
Size: 649 Bytes
Versions: 23
Compression:
Stored size: 649 Bytes
Contents
RSpec.describe ROM::Relation, '#prefix' do subject(:relation) { container.relations.users } include_context 'users and tasks' before do conf.relation(:users) do schema(infer: true) def sorted order(:id) end end end with_adapters do it 'projects the dataset using new column names' do prefixed = relation.sorted.prefix(:user) expect(prefixed.first).to eql(user_id: 1, user_name: 'Jane') end it 'uses singularized table name as the default prefix' do prefixed = relation.sorted.prefix expect(prefixed.first).to eql(user_id: 1, user_name: 'Jane') end end end
Version data entries
23 entries across 23 versions & 1 rubygems