Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

Commit

Permalink
[dm-aggregates] Use Property#load to load the values from the datastore
Browse files Browse the repository at this point in the history
* This change allows a normal and custom property to be used
  interchangeably
* Previously used Property#typecast, which is primarily geared towards
  taking external input and converting it into an internal representation.

[#584 state:resolved]
  • Loading branch information
dkubb committed Feb 4, 2010
1 parent 178bc58 commit 19b1710
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions dm-aggregates/lib/dm-aggregates/adapters/data_objects_adapter.rb
Expand Up @@ -27,7 +27,7 @@ def aggregate(query)
if field.respond_to?(:operator)
send(field.operator, field.target, value)
else
field.typecast(value)
field.load(value)
end
end

Expand All @@ -48,19 +48,19 @@ def count(property, value)
end

def min(property, value)
property.typecast(value)
property.load(value)
end

def max(property, value)
property.typecast(value)
property.load(value)
end

def avg(property, value)
property.type == Integer ? value.to_f : property.typecast(value)
property.type == Integer ? value.to_f : property.load(value)
end

def sum(property, value)
property.typecast(value)
property.load(value)
end

module SQL
Expand Down

0 comments on commit 19b1710

Please sign in to comment.