Skip to content

Commit

Permalink
fix for type_cast_calculated_value has already been applied to rails …
Browse files Browse the repository at this point in the history
…5.2, so we don't need to it anymore
  • Loading branch information
lk0001 committed Jan 19, 2021
1 parent 1a800df commit d88952e
Showing 1 changed file with 0 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ def calculate(operation, column_name)
def build_count_subquery(relation, column_name, distinct)
super(relation.unscope(:order), column_name, distinct)
end

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
else type.deserialize(value)
end
end
end
end
end
Expand Down

0 comments on commit d88952e

Please sign in to comment.