Rails statistics gem not joining filters -
i using rails gem 'statistics' , have added gem in other projects , have not had problem. using line add filters:
define_statistic :sum_charged, :sum => :all, :column_name => "timelogs.charged_amount", :conditions => "subscription_opt_in = true"
or using filter_all_stats_on(:created_after, "timelogs.created_at > ?")
add additional filters on statistics...
however whenever call puts timelog.get_stat(:sum_charged, :created_after => 1.year.ago)
example, sum() query gets run on database, without statements...
select sum(timelogs.charged_amount) sum_id `timelogs`
what missing in order add filters query?
thanks.
looks issue of using gem in rails 4.1.x -- reverted app 4.0.9 , works great. there issue base.send() function gets sent without filter parameters.
Comments
Post a Comment