diff --git a/app/controllers/adburndown_controller.rb b/app/controllers/adburndown_controller.rb index 0830397..a41c726 100644 --- a/app/controllers/adburndown_controller.rb +++ b/app/controllers/adburndown_controller.rb @@ -55,6 +55,19 @@ def show # 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} +=begin + 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 +=end @changes = @changes.to_json end diff --git a/app/controllers/adtaskinl_controller.rb b/app/controllers/adtaskinl_controller.rb index e6e01aa..bd1dc8a 100644 --- a/app/controllers/adtaskinl_controller.rb +++ b/app/controllers/adtaskinl_controller.rb @@ -70,8 +70,9 @@ def spent def inplace # element_id filtered too! attribs = params.select{|k,v| k != 'id' && k != 'project_id' && SprintsTasks.column_names.include?(k) } - param_id = attribs[0][0] - attribs = Hash[*attribs.flatten] + attribs = attribs.flatten + param_id = attribs[0] + attribs = Hash[*attribs] task = SprintsTasks.find(params[:id], :include => :assigned_to) begin task.init_journal(User.current)