Changeset 4192
- Timestamp:
- 04/06/06 20:10:44 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activerecord/lib/active_record/calculations.rb
r4185 r4192 146 146 def construct_calculation_sql(aggregate, aggregate_alias, options) #:nodoc: 147 147 scope = scope(:find) 148 sql = ["SELECT #{aggregate} AS #{aggregate_alias}"]148 sql = "SELECT #{aggregate} AS #{aggregate_alias}" 149 149 sql << ", #{options[:group_field]} AS #{options[:group_alias]}" if options[:group] 150 150 sql << " FROM #{table_name} " … … 155 155 sql << " ORDER BY #{options[:order]}" if options[:order] 156 156 add_limit!(sql, options) 157 sql .join157 sql 158 158 end 159 159