    # File lib/active_record/calculations.rb, line 125
          def calculate(operation, column_name, options = {})
            validate_calculation_options(operation, options)
            column_name     = options[:select] if options[:select]
            column_name     = '*' if column_name == :all
            column          = column_for column_name
            catch :invalid_query do
              if options[:group]
                return execute_grouped_calculation(operation, column_name, column, options)
              else
                return execute_simple_calculation(operation, column_name, column, options)
              end
            end
            0
          end