Skip to content

Commit

Permalink
#18
Browse files Browse the repository at this point in the history
  • Loading branch information
markablov committed Aug 14, 2012
1 parent 832dee7 commit 4d14649
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions app/controllers/adburndown_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 3 additions & 2 deletions app/controllers/adtaskinl_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4d14649

Please sign in to comment.