[Delivers #102267428] pick highest pending approver on the stack #650
Conversation
Looks like this is blowing up https://gist.github.com/phirefly/4f725ae6de6a4b43933f#file-error-2015-09-25-L7 likely because these records don't have pending approvals: |
…ovals before accessing one, falling back to approving_official if !pending exists
I think bf1170c should fix it, whenever we return to QAing this. |
1 similar comment
Updated #current_approver_email_address
@phirefly if/when this passes for you in stage, feel free to merge. |
@@ -114,8 +114,13 @@ def approving_official | |||
self.approvers.first | |||
end | |||
|
|||
def approving_official_email_address | |||
approving_official ? approving_official.email_address : self.system_approver_emails.first | |||
# the highest approver on the stack, pending preferred if status indicates |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about not having a comment here? I think this method's tests make it clear why it works this way, and having the comment could lead to more complications down the line.
For more details on this line of thinking, this is a killer blog post on why code comments can be tricky https://robots.thoughtbot.com/letting-your-code-speak-for-itself by the one and only @adarsh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:thumbs_up:
On Monday, October 5, 2015, Jessie A. Young notifications@github.com
wrote:
In app/models/ncr/work_order.rb
#650 (comment):@@ -114,8 +114,13 @@ def approving_official
self.approvers.first
end
- def approving_official_email_address
approving_official ? approving_official.email_address : self.system_approver_emails.first
the highest approver on the stack, pending preferred if status indicates
what do you think about not having a comment here? I think this method's
tests make it clear why it works this way, and having the comment could
lead to more complications down the line.For more details on this line of thinking, this is a killer blog post on
why code comments can be tricky
https://robots.thoughtbot.com/letting-your-code-speak-for-itself by the
one and only @adarsh https://github.com/adarsh—
Reply to this email directly or view it on GitHub
https://github.com/18F/C2/pull/650/files#r41155349.
@adarshp http://www.twitter.com/adarshp
313.454.1515 (mobile)
See when I am free: http://bit.ly/adarshcal
[Delivers #102267428] pick highest pending approver on the stack
fixes bug reported in QA for https://www.pivotaltracker.com/story/show/102267428