diff --git a/app/controllers/adburndown_controller.rb b/app/controllers/adburndown_controller.rb index a41c726..b0870cb 100644 --- a/app/controllers/adburndown_controller.rb +++ b/app/controllers/adburndown_controller.rb @@ -54,7 +54,7 @@ def show @changes = [] # restcondchanges = ActiveRecord::Base::sanitize_sql(restcondtasks) restcondchanges = ActiveRecord::Base.send(:sanitize_sql, restcondtasks, '') - ActiveRecord::Base.connection.select_all("select * from (select old_value as value, journalized_id as issueId, prop_key, DATE(journals.created_on) created_on from `journals` inner join journal_details on (journals.id = journal_id) inner join issues on (issues.id = journalized_id) where journalized_type = 'Issue' and property = 'attr' and (prop_key = 'estimated_hours' or prop_key = 'done_ratio') and #{restcondchanges} order by journals.id desc) a group by `issueId`, created_on, prop_key order by created_on desc").each{|row| @changes << row} + ActiveRecord::Base.connection.select_all("select max(COALESCE(old_value::float,0)) as value, journalized_id as issueId, prop_key, DATE(journals.created_on) AS created_on from journals inner join journal_details on (journals.id = journal_id) inner join issues on (issues.id = journalized_id) where journalized_type = 'Issue' and property = 'attr' and (prop_key = 'estimated_hours' or prop_key = 'done_ratio') and #{restcondchanges} group by 2, 3, 4 order by created_on desc").each{|row| @changes << row} =begin select * from ( @@ -77,4 +77,4 @@ def find_project # @project variable must be set before calling the authorize filter @project = Project.find(params[:project_id]) end -end \ No newline at end of file +end diff --git a/app/views/adburndown/show.html.erb b/app/views/adburndown/show.html.erb index be39c15..8a72a6c 100644 --- a/app/views/adburndown/show.html.erb +++ b/app/views/adburndown/show.html.erb @@ -6,7 +6,7 @@ + +