diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-01-19 20:43:03 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-01-19 20:43:03 +0530 |
commit | ec63fdcff35d9ee195e11043ba3219b1e341a3f2 (patch) | |
tree | de7bbcac06efcb46464775bef5c5e425fabe7fb9 /activerecord/lib/active_record/relation/calculation_methods.rb | |
parent | 73b179eb689611ac0518584b21f2304756a7e981 (diff) | |
download | rails-ec63fdcff35d9ee195e11043ba3219b1e341a3f2.tar.gz rails-ec63fdcff35d9ee195e11043ba3219b1e341a3f2.tar.bz2 rails-ec63fdcff35d9ee195e11043ba3219b1e341a3f2.zip |
Get rid of construct_count_options_from_args
Diffstat (limited to 'activerecord/lib/active_record/relation/calculation_methods.rb')
-rw-r--r-- | activerecord/lib/active_record/relation/calculation_methods.rb | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/activerecord/lib/active_record/relation/calculation_methods.rb b/activerecord/lib/active_record/relation/calculation_methods.rb index b96b69a18e..53d8594da8 100644 --- a/activerecord/lib/active_record/relation/calculation_methods.rb +++ b/activerecord/lib/active_record/relation/calculation_methods.rb @@ -180,32 +180,6 @@ module ActiveRecord end end - def construct_count_options_from_args(*args) - options = {} - column_name = :all - - # Handles count(), count(:column), count(:distinct => true), count(:column, :distinct => true) - case args.size - when 0 - select = get_projection_name_from_chained_relations - column_name = select if select !~ /(,|\*)/ - when 1 - if args[0].is_a?(Hash) - select = get_projection_name_from_chained_relations - column_name = select if select !~ /(,|\*)/ - options = args[0] - else - column_name = args[0] - end - when 2 - column_name, options = args - else - raise ArgumentError, "Unexpected parameters passed to count(): #{args.inspect}" - end - - [column_name || :all, options] - end - # Converts the given keys to the value that the database adapter returns as # a usable column name: # @@ -243,10 +217,6 @@ module ActiveRecord column ? column.type_cast(value) : value end - def get_projection_name_from_chained_relations - @select_values.join(", ") if @select_values.present? - end - def select_for_count if @select_values.present? select = @select_values.join(", ") |