Flowdock
method

construct_count_options_from_args

Importance_0
Ruby on Rails latest stable (v4.1.8) - 0 notes - Class: ActiveRecord::Calculations::ClassMethods

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v2.3.8) is shown here.

construct_count_options_from_args(*args) protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activerecord/lib/active_record/calculations.rb, line 141
        def construct_count_options_from_args(*args)
          options     = {}
          column_name = :all
          
          # We need to handle
          #   count()
          #   count(:column_name=:all)
          #   count(options={})
          #   count(column_name=:all, options={})
          case args.size
          when 1
            args[0].is_a?(Hash) ? options = args[0] : column_name = args[0]
          when 2
            column_name, options = args
          else
            raise ArgumentError, "Unexpected parameters passed to count(): #{args.inspect}"
          end if args.size > 0
          
          [column_name, options]
        end
Register or log in to add new notes.