-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rescue instead if actiontext could not be found #706
rescue instead if actiontext could not be found #706
Conversation
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.
Thanks for this suggestion! It makes a lot of sense to me. We really appreciate everyone's efforts to make the gem better. I had one question before we merge this PR.
require "#{Gem::Specification.find_by_name('actiontext').gem_dir}/app/helpers/action_text/tag_helper" | ||
rescue Gem::MissingSpecError |
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.
I can see why this is a better solution. I wonder if it would be worthwhile writing an error message in the rescue
case. It might be better than silently swallowing the error. (Admittedly this could also be said of the current code.) What do you think?
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.
That would mean that any application that is loaded without actiontext would always get an error message. It might be more useful to put error handling when the user attempts to use the action text tag helper.
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.
Of course. Good point. And when they try to use the action text helper, they'll get a obvious (by Rails standards, at least) error message. Thanks for walking me through the thinking!
You can ignore the failures against edge Rails, but please fix up the lint issue by ignoring the RuboCop warning. |
@lcreid done! |
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.
Thanks again for this PR!
No description provided.