Sha256: 9c4e24a9d5ebb29db39f77b6e2d68a090e7bee9009e8ba3091f96246eb8d5c05
Contents?: true
Size: 771 Bytes
Versions: 16
Compression:
Stored size: 771 Bytes
Contents
require 'spec_helper' RSpec.describe 'Defining a view using schemas', seeds: false do include_context 'users' with_adapters do describe 'defining a projected view' do before do conf.relation(:users) do schema(infer: true) view(:names) do schema { project(:name) } relation { order(:name, :id) } end end container.relations[:users].insert(name: 'Joe') container.relations[:users].insert(name: 'Jane') container.relations[:users].insert(name: 'Jade') end it 'automatically projects a relation view' do expect(relations[:users].names.to_a) .to eql([{ name: 'Jade' }, { name: 'Jane' }, { name: 'Joe' }]) end end end end
Version data entries
16 entries across 16 versions & 1 rubygems