Add bang version to OrderedOptions - #20208
Conversation
|
Thank you for the pull request.
Not true. There is no rule about this in any place and even if it is a rule, there is cases where it doesn't make sense. I'm having problem to understand where this would be useful, could you give us an example? |
|
@rafaelfranca Absolutely right, there is no such rule.
Case in point if (slack_url = Rails.application.secrets.slack_url).present?
$slack_notifier = Slack::Notifier.new(slack_url)
else
Rails.logger.error("Unable to find slack_url in secrets.yml")
raise "Unable to find slack_url in secrets.yml"
endgets replaced by $slack_notifier = Slack::Notifier.new(Rails.application.secrets.slack_url!)This is a similar style to What do you think? |
There was a problem hiding this comment.
Can we use if/else? The line is too long.
|
PR Updated according to feedback given. |
By: Aditya Sanghi(@asanghi) Gaurish Sharma(gaurish)
|
/cc @rafaelfranca seems okay now? |
Add bang version to OrderedOptions
There was a problem hiding this comment.
Small nitpick: The last closing parens should be deleted.
Every method should have a bang counter-part. if someone uses a bang version & its not defined. it will raise an ArgumentError.
example(normal version)
Rails.application.secrets.big_querybang version
Rails.application.secrets.big_query!By:
Aditya Sanghi(@asanghi)
Gaurish Sharma(@gaurish)