1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #35289 from LinkUpStudioUA/master

AbstractController::Translation#t: dup options
This commit is contained in:
Rafael França 2019-02-15 11:35:26 -05:00 committed by GitHub
commit a25282ed1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,6 +11,7 @@ module AbstractController
# to translate many keys within the same controller / action and gives you a
# simple framework for scoping them consistently.
def translate(key, options = {})
options = options.dup
if key.to_s.first == "."
path = controller_path.tr("/", ".")
defaults = [:"#{path}#{key}"]