Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport: Fix TimeWithZone#eql? to handle TimeWithZone created from DateTime #21870

Merged
merged 1 commit into from Oct 5, 2015

Conversation

repinel
Copy link
Member

@repinel repinel commented Oct 5, 2015

Backport of #20944.

Before:

  twz = DateTime.now.in_time_zone
  twz.eql?(twz.dup) => false

Now:

  twz = DateTime.now.in_time_zone
  twz.eql?(twz.dup) => true

Before:

```ruby
  twz = DateTime.now.in_time_zone
  twz.eql?(twz.dup) => false
```

Now:

```ruby
  twz = DateTime.now.in_time_zone
  twz.eql?(twz.dup) => true
```

Please notice that this fix the `TimeWithZone` comparison to itself,
not to `DateTime`. Based on rails#3725, `DateTime` should not be equal to
`TimeWithZone`.
@rails-bot
Copy link

r? @pixeltrix

(@rails-bot has picked a reviewer for you, use r? to override)

@rails-bot
Copy link

warning Warning warning

  • Pull requests are usually filed against the master branch for this repo, but this one is against 4-2-stable. Please double check that you specified the right target!

pixeltrix added a commit that referenced this pull request Oct 5, 2015
Backport: Fix `TimeWithZone#eql?` to handle `TimeWithZone` created from `DateTime`
@pixeltrix pixeltrix merged commit 5227896 into rails:4-2-stable Oct 5, 2015
@pixeltrix
Copy link
Contributor

@repinel thanks for the backport

@repinel repinel deleted the fix-time-with-zone-eql-4-2-2 branch October 5, 2015 17:38
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.

None yet

3 participants