-
Notifications
You must be signed in to change notification settings - Fork 120
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
Reduce dependencies on I18nRenderer #2076
Merged
Merged
Conversation
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
I've left a couple of small comments but in general this looks good to me. |
I want to be able to change the `SmartAnswer::QuestionPresenter` to use the `SmartAnswer::ErbRenderer` and so anything I can do to reduce the dependencies on the `I18nRenderer` will make this easier. This commit introduces a little duplication in the question presenter sub-classes. I plan to fix that in a later commit.
I want to be able to change the `SmartAnswer::QuestionPresenter` to use the `SmartAnswer::ErbRenderer` and so anything I can do to reduce the dependencies on the `I18nRenderer` will make this easier.
I want to use this helper for formatting values in questions, so I've made the name more generic.
The `SmartAnswer::FormattingHelper` had an implicit dependency on `ActionView::Helpers::NumberHelper`. This helper is currently only being used in the `SmartAnswer::ErbRenderer` which includes it and the `ActionView::Helpers::NumberHelper` into the view object, thus satisfying the implicit dependency. I want to use this helper from within some of the sub-classes of `QuestionPresenter`. Including `ActionView::Helpers::NumberHelper` explicitly should make this easier. I've left `ActionView::Helpers::NumberHelper` being included into the view, because there is code in some templates which use methods on this module directly i.e. not via `SmartAnswer::FormattingHelper`.
This feels as if it makes the code a bit more consistent i.e. all formatting is either in `SmartAnswer::I18nRenderer#value_for_interpolation` or in methods on `SmartAnswer::FormattingHelper`.
6ea3bf3
to
1395259
Compare
I've addressed @chrisroos' suggestions, rebased against master and force-pushed in preparation for merging. |
floehopper
added a commit
that referenced
this pull request
Nov 13, 2015
…nderer Reduce dependencies on I18nRenderer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I want to be able to change the
SmartAnswer::QuestionPresenter
to use theSmartAnswer::ErbRenderer
instead of theSmartAnswer::I18nRenderer
and so anything I can do to reduce the dependencies on theI18nRenderer
will make this easier.Expected observable changes