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

Argument error #118

Merged
merged 1 commit into from
Nov 20, 2020
Merged

Argument error #118

merged 1 commit into from
Nov 20, 2020

Conversation

joshuapinter
Copy link
Contributor

@joshuapinter joshuapinter commented Nov 20, 2020

Raise ArgumentError when nil is passed for time.

This matches the default behaviour of distance_of_time_in_words.

Fixes #85.

After this commit

$ distance_of_time_in_words( nil )
#=> ArgumentError (nil can't be converted to a Time value)

$ distance_of_time_in_words( nil, nil, false, vague: true )
#=> ArgumentError (nil can't be converted to a Time value)

$ distance_of_time_in_words_to_now( nil )
#=> ArgumentError (nil can't be converted to a Time value)

$ distance_of_time_in_words_to_now( nil, false, vague: true )
#=> ArgumentError (nil can't be converted to a Time value)

$ time_ago_in_words( nil )
#=> ArgumentError (nil can't be converted to a Time value)

@joshuapinter joshuapinter marked this pull request as ready for review November 20, 2020 19:31
This matches the default behaviour of `distance_of_time_in_words`.

Fixes #85.

### After this commit

```ruby
$ distance_of_time_in_words( nil )
#=> ArgumentError (nil can't be converted to a Time value)

$ distance_of_time_in_words( nil, nil, false, vague: true )
#=> ArgumentError (nil can't be converted to a Time value)

$ distance_of_time_in_words_to_now( nil )
#=> ArgumentError (nil can't be converted to a Time value)

$ distance_of_time_in_words_to_now( nil, false, vague: true )
#=> ArgumentError (nil can't be converted to a Time value)

$ time_ago_in_words( nil )
#=> ArgumentError (nil can't be converted to a Time value)
```
@dblock
Copy link
Collaborator

dblock commented Mar 18, 2021

This was released in 5.3.0.

@joshuapinter
Copy link
Contributor Author

👍

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.

Alters the default behavior of distance_of_time_in_words_to_now
2 participants