Skip to content

Instantly share code, notes, and snippets.

@retorquere
Created November 4, 2011 11:04
Show Gist options
  • Save retorquere/1339103 to your computer and use it in GitHub Desktop.
Save retorquere/1339103 to your computer and use it in GitHub Desktop.
issue = Issue.find(35)
if issue.is_task?
issue = issue.becomes(RbTask)
elsif issue.is_story?
issue = issue.becomes(RbStory)
else
raise "Neither a task nor a story"
end
puts issue.burndown.inspect
puts issue.velocity_based_estimate if issue.is_story?
puts issue.remaining_hours
@fdasoghe
Copy link

fdasoghe commented Nov 4, 2011

/usr/local/redmine# cat commands
issue = Issue.find(35)
puts issue.velocity_based_estimate
puts issue.remaining_hours

/usr/local/redmine# script/runner commands
/usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_merged_array.rb:60:in add': undefined methodeach_pair' for #Array:0x7f6538adcfd8 (NoMethodError)
from /usr/local/redmine/vendor/plugins/redmine_backlogs/app/models/rb_sprint.rb:23:in initialize' from /usr/local/redmine/vendor/plugins/redmine_backlogs/app/models/rb_sprint.rb:23:ineach'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/app/models/rb_sprint.rb:23:in initialize' from /usr/local/redmine/vendor/plugins/redmine_backlogs/app/models/rb_sprint.rb:231:innew'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/app/models/rb_sprint.rb:231:in burndown' from /usr/local/redmine/vendor/plugins/redmine_backlogs/app/models/rb_sprint.rb:215:inactivity'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:109:in test_active' from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:40:insend'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:40:in initialize' from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:39:ineach'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:39:in initialize' from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:165:innew'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:165:in scrum_statistics' from /usr/local/redmine/vendor/rails/activesupport/lib/active_support/cache.rb:162:infetch'
from /usr/local/redmine/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in ms' from /usr/lib/ruby/1.8/benchmark.rb:308:inrealtime'
from /usr/local/redmine/vendor/rails/activesupport/lib/active_support/core_ext/benchmark.rb:17:in ms' from /usr/local/redmine/vendor/rails/activesupport/lib/active_support/cache.rb:162:infetch'
from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_project_patch.rb:165:in scrum_statistics' from /usr/local/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:insend'
from /usr/local/redmine/vendor/rails/activerecord/lib/active_record/associations/association_proxy.rb:215:in method_missing' from /usr/local/redmine/vendor/plugins/redmine_backlogs/lib/backlogs_issue_patch.rb:90:invelocity_based_estimate'
from comandi:2
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in eval' from /usr/local/redmine/vendor/rails/railties/lib/commands/runner.rb:46 from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/runner:3

@fdasoghe
Copy link

fdasoghe commented Nov 7, 2011

{:points_resolved=>[nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 3.0, nil, nil, nil, nil, 5.0, 5.0, 5.0], :points_accepted=>[nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil], :points=>[nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 3.0, 3.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0], :hours=>[nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, 24.0, 0.0, 8.0, 8.0, 8.0, 8.0, 0.0, 0.0, 0.0]}
0
0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment