Created
September 30, 2015 15:12
-
-
Save shipiev/5b208368297aac148727 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logins = %i{zabrovskiy lisichkin serkin sokorev romnychev minzhynkov mescheryakova shipiev svyatskaya bykovchenko} | |
logins.inject do |result, login| | |
user_id = User.where(login: login).first.id | |
issues = Issue.where(assigned_to_id: user_id, fixed_version_id: 2279). | |
spent_full = | |
issues.joins(:time_entries).where('time_entries.created_on >= DATE("2015-09-15")'). | |
pluck('SUM(time_entries.hours) AS sum_hours').first | |
est = issues.pluck('SUM(issues.estimated_hours) AS est_hours').first | |
coef = est.to_f/spent_full.to_f | |
result.merge login => {coef: coef, est: est, spent_full: spent_full} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment