jcasimir / locale_setter

A simple library to set request locale based on a hierarchy of factors
MIT License
118 stars 18 forks source link

LocaleSetter::USER_METHOD unused #2

Closed lagartoflojo closed 11 years ago

lagartoflojo commented 11 years ago

There's a USER_METHOD in the LocaleSetter module, but unlike URL_PARAM and HTTP_HEADER, it's not used.

In User:

if user && user.respond_to?(:locale) && user.locale && !user.locale.empty?
  LocaleSetter::Matcher.match(user.language, available)
end

Maybe this should look like:

if user && user.respond_to?(USER_METHOD) && user.send(USER_METHOD) && !user.send(USER_METHOD).empty?
  LocaleSetter::Matcher.match(user.send(USER_METHOD), available)
end