Skip to content

Commit

Permalink
Don't try to Time.parse a "Time" object
Browse files Browse the repository at this point in the history
With Ruby2.7, Time can't be converted into a String implicitly. The way
we use Time.parse, we don't need to convert the Time object into a
String just to convert it into a Time object again (using Time.parse).

Fixes #815.
  • Loading branch information
agraul committed Oct 26, 2020
1 parent 59da8cd commit 18c3248
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def set_releases_parameters
now = Time.now
versions.each do |version|
version['releases'].reject! do |release|
release['date'] = Time.parse(release['date'])
release['date'] = Time.parse(release['date']) unless release['date']
release['date'] > now
end
# Get the latest release
Expand Down

0 comments on commit 18c3248

Please sign in to comment.