Use prepend_before_filter instead of append_before_filter - #5
Open
paolodona wants to merge 4 commits into
Open
Conversation
added 3 commits
April 22, 2013 06:26
…lters have access to the locale set
…lters have access to the locale set
Owner
|
Unless I'm mistaken, the problem with doing this is that if your current_user is set by another filter, you won't have access to it to set the user_locale, so I don't think prepending is the right solution either. I'm going to have to think about it. Incidentally, this is why I add the |
This file contains hidden or 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
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.
This change allows other filter to find the locale set correctly and use it (eg: for redirection).
this is useful when we cannot specify the order of the filters (eg: filters are loaded by gems)
In my particular case, I'm using resources controller (rc_rails), which adds a filter that doesn't find the locale set.
Paolo