aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/relation/calculations.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 20:20:22 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 20:20:22 +0200
commitb326e82dc012d81e9698cb1f402502af1788c1e9 (patch)
tree6b6452129a5b6b684f3d44f21afd2b1bea83fa22 /activerecord/lib/active_record/relation/calculations.rb
parent80e66cc4d90bf8c15d1a5f6e3152e90147f00772 (diff)
downloadrails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.gz
rails-b326e82dc012d81e9698cb1f402502af1788c1e9.tar.bz2
rails-b326e82dc012d81e9698cb1f402502af1788c1e9.zip
applies remaining conventions across the project
Diffstat (limited to 'activerecord/lib/active_record/relation/calculations.rb')
-rw-r--r--activerecord/lib/active_record/relation/calculations.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/calculations.rb b/activerecord/lib/active_record/relation/calculations.rb
index 233a0622d5..ecf3700aab 100644
--- a/activerecord/lib/active_record/relation/calculations.rb
+++ b/activerecord/lib/active_record/relation/calculations.rb
@@ -355,9 +355,9 @@ module ActiveRecord
def type_cast_calculated_value(value, type, operation = nil)
case operation
- when "count" then value.to_i
- when "sum" then type.deserialize(value || 0)
- when "average" then value.respond_to?(:to_d) ? value.to_d : value
+ when "count" then value.to_i
+ when "sum" then type.deserialize(value || 0)
+ when "average" then value.respond_to?(:to_d) ? value.to_d : value
else type.deserialize(value)
end
end