Skip to content

Use prepend_before_filter instead of append_before_filter - #5

Open
paolodona wants to merge 4 commits into
mateomurphy:masterfrom
paolodona:master
Open

Use prepend_before_filter instead of append_before_filter#5
paolodona wants to merge 4 commits into
mateomurphy:masterfrom
paolodona:master

Conversation

@paolodona

Copy link
Copy Markdown

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

@mateomurphy

Copy link
Copy Markdown
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 automatically_detect config option, as I figured some people would need finer grained control over loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants