Skip to content

Commit

Permalink
Merge a1ceba8 into 8e4ddaf
Browse files Browse the repository at this point in the history
  • Loading branch information
leoarnold committed Nov 11, 2018
2 parents 8e4ddaf + a1ceba8 commit 3abc833
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/money/money/formatting_rules.rb
Expand Up @@ -103,15 +103,18 @@ def symbol_position_from(rules)

def warn_about_deprecated_rules(rules)
if rules.has_key?(:symbol_position)
warn '[DEPRECATION] `symbol_position:` option is deprecated - use `format` to specify the formatting template.'
position = rules[:symbol_position]
template = position == :before ? '%u %n' : '%n %u'

warn "[DEPRECATION] `symbol_position: :#{position}` is deprecated - you can replace it with `format: #{template}`"
end

if rules.has_key?(:symbol_before_without_space)
warn '[DEPRECATION] `symbol_before_without_space:` option is deprecated - use `format` to specify the formatting template.'
warn "[DEPRECATION] `symbol_before_without_space:` option is deprecated - you can replace it with `format: '%u%n'`"
end

if rules.has_key?(:symbol_after_without_space)
warn '[DEPRECATION] `symbol_after_without_space:` option is deprecated - use `format` to specify the formatting template.'
warn "[DEPRECATION] `symbol_after_without_space:` option is deprecated - you can replace it with `format: '%n%u'`"
end

if rules.has_key?(:html)
Expand All @@ -121,7 +124,6 @@ def warn_about_deprecated_rules(rules)
if rules.has_key?(:html_wrap_symbol)
warn "[DEPRECATION] `html_wrap_symbol` is deprecated - use `html_wrap` instead. Please note that `html_wrap` will wrap all parts of currency."
end

end
end
end

0 comments on commit 3abc833

Please sign in to comment.