From 9daa0bbe153f1a85319c97756aebcda82bac7bdd Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 16 Aug 2010 17:44:48 -0700 Subject: adding some activerecord compatibility --- spec/arel/activerecord_compat_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 spec/arel/activerecord_compat_spec.rb (limited to 'spec/arel/activerecord_compat_spec.rb') diff --git a/spec/arel/activerecord_compat_spec.rb b/spec/arel/activerecord_compat_spec.rb new file mode 100644 index 0000000000..a7eeb7e5ee --- /dev/null +++ b/spec/arel/activerecord_compat_spec.rb @@ -0,0 +1,18 @@ +require 'spec_helper' + +module Arel + describe 'activerecord compatibility' do + describe 'select manager' do + it 'provides wheres' do + table = Table.new :users + manager = Arel::SelectManager.new Table.engine + manager.where table[:id].eq 1 + manager.where table[:name].eq 'Aaron' + + check manager.wheres.map { |x| + x.value + }.join(', ').should == "\"users\".\"id\" = 1, \"users\".\"name\" = 'Aaron'" + end + end + end +end -- cgit v1.2.3