Sha256: 0182418f86bd77af2584e8aa215df033136f5acfb95fa3f09a9edcb1079578b5
Contents?: true
Size: 482 Bytes
Versions: 8
Compression:
Stored size: 482 Bytes
Contents
require 'helper' describe Arel::Nodes::Extract do it "should extract field" do table = Arel::Table.new :users table[:timestamp].extract('date').to_sql.must_be_like %{ EXTRACT(DATE FROM "users"."timestamp") } end describe "as" do it 'should alias the extract' do table = Arel::Table.new :users table[:timestamp].extract('date').as('foo').to_sql.must_be_like %{ EXTRACT(DATE FROM "users"."timestamp") AS foo } end end end
Version data entries
8 entries across 3 versions & 3 rubygems