diff options
author | arkadiy kraportov <arkadiyk@gmail.com> | 2011-06-10 12:47:55 +0900 |
---|---|---|
committer | arkadiy kraportov <arkadiyk@gmail.com> | 2011-06-10 12:47:55 +0900 |
commit | 3da816a77318d28617d0e12739d29d76e372a4f9 (patch) | |
tree | 16b542f2712f8669cda97b3d1a784ef193b9d333 /lib | |
parent | be48ed3071fd6524d0145c4ad3faeb4aafe3eda3 (diff) | |
download | rails-3da816a77318d28617d0e12739d29d76e372a4f9.tar.gz rails-3da816a77318d28617d0e12739d29d76e372a4f9.tar.bz2 rails-3da816a77318d28617d0e12739d29d76e372a4f9.zip |
remove unnecessary guarding agains literal
Diffstat (limited to 'lib')
-rw-r--r-- | lib/arel/visitors/mssql.rb | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/lib/arel/visitors/mssql.rb b/lib/arel/visitors/mssql.rb index 713ad0f0f8..23dc06a936 100644 --- a/lib/arel/visitors/mssql.rb +++ b/lib/arel/visitors/mssql.rb @@ -24,7 +24,6 @@ module Arel x.projections = [row_num_literal(core_order_by)] is_select_count = true else - guard_against_select_constant! x x.projections << row_num_literal(core_order_by) end @@ -63,21 +62,12 @@ module Arel x.projections.length == 1 && Arel::Nodes::Count === x.projections.first end - def guard_against_select_constant! x - # guard against .select(1) (i.e. validate_uniqueness uses it to minimize qry result set) - # todo it won't work for .select('a'), which is probably ok. 'coz of workaround: .select("'a' as a") - x.projections.map! do |p| - p.kind_of?(Fixnum) ? Nodes::SqlLiteral.new("#{p} as _fld_#{p}") : p - end - end - # fixme raise exception of there is no pk? # fixme!! Table.primary_key will be depricated. What is the replacement?? def find_left_table_pk o return visit o.primary_key if o.instance_of? Arel::Table find_left_table_pk o.left if o.kind_of? Arel::Nodes::Join end - end end end |