Skip to content

Return nil when currency cannot be converted for comparison#549

Merged
semmons99 merged 1 commit into
RubyMoney:masterfrom
createdbypete:ruby-comparison-warning
Aug 27, 2015
Merged

Return nil when currency cannot be converted for comparison#549
semmons99 merged 1 commit into
RubyMoney:masterfrom
createdbypete:ruby-comparison-warning

Conversation

@createdbypete
Copy link
Copy Markdown
Contributor

In the future Ruby releases #== will no longer rescue exceptions and expects #<=> to return nil if the comparison is inappropriate (because in Money #== is provided by Comparable)

I know this has come up in a couple of times before but Ruby is complaining louder in spec output now (because some specs should be breaking and raising Money::Bank::UnknownRate).

I guess this follows on from work done in #528

- In the next Ruby release #== will no longer rescue exceptions and
  expects #<=> to return nil if the comparison is inappropriate
- Comparable#== will not rescue exceptions of #<=> in the next
  release
semmons99 added a commit that referenced this pull request Aug 27, 2015
Return nil when currency cannot be converted for comparison
@semmons99 semmons99 merged commit df4808e into RubyMoney:master Aug 27, 2015
@semmons99
Copy link
Copy Markdown
Member

thanks!

@createdbypete createdbypete deleted the ruby-comparison-warning branch August 27, 2015 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants