lib/i18n/tasks/scanners/relative_keys.rb in i18n-tasks-0.9.24 vs lib/i18n/tasks/scanners/relative_keys.rb in i18n-tasks-0.9.25
- old
+ new
@@ -39,10 +39,10 @@
# @param normalized_path [String] path/relative/to/a/root
# @param calling_method [#call, Symbol, String, false, nil]
def prefix(normalized_path, calling_method: nil)
file_key = normalized_path.gsub(%r{(\.[^/]+)*$}, '').tr(File::SEPARATOR, DOT)
calling_method = calling_method.call if calling_method.respond_to?(:call)
- if calling_method && calling_method.present?
+ if calling_method&.present?
# Relative keys in mailers have a `_mailer` infix, but relative keys in controllers do not have one:
"#{file_key.sub(/_controller$/, '')}.#{calling_method}"
else
# Remove _ prefix from partials
file_key.gsub(/\._/, DOT)