Skip to content

Commit

Permalink
Merge pull request #20 from macav/master
Browse files Browse the repository at this point in the history
Fix deprecation warning in Ruby 2.7
  • Loading branch information
frantisekrokusek authored Aug 13, 2020
2 parents 2b804d7 + 29b5d21 commit 613858b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/json_translate/translates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def translates(*attrs, allow_blank: false)

attrs.each do |attr_name|
define_method attr_name do |**params|
read_json_translation(attr_name, params)
read_json_translation(attr_name, **params)
end

define_method "#{attr_name}=" do |value|
Expand All @@ -30,7 +30,7 @@ def translates(*attrs, allow_blank: false)
normalized_locale = locale.to_s.downcase.gsub(/[^a-z]/, '')

define_method :"#{attr_name}_#{normalized_locale}" do |**params|
read_json_translation(attr_name, locale, false, params)
read_json_translation(attr_name, locale, false, **params)
end

define_method "#{attr_name}_#{normalized_locale}=" do |value|
Expand Down

0 comments on commit 613858b

Please sign in to comment.