Skip to content

Commit

Permalink
[frontend] Directly parse buildtime as DateTime
Browse files Browse the repository at this point in the history
  • Loading branch information
bgeuken committed Jun 19, 2018
1 parent 8585865 commit bbd005c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/api/app/models/binary_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,14 @@ def reset_cache
Rails.cache.delete("xml_binary_release_#{cache_key}")
end

# rubocop:disable Style/DateTime
def indentical_to?(binary_hash)
binary_disturl == binary_hash['disturl'] &&
binary_supportstatus == binary_hash['supportstatus'] &&
binary_buildtime &&
binary_buildtime.to_datetime.utc == ::Time.at(binary['buildtime'].to_i).to_datetime.utc
binary_buildtime.to_datetime.utc == DateTime.strptime(binary['buildtime'].to_s, '%s').utc
end
# rubocop:enable Style/DateTime
#### Alias of methods
end

Expand Down

0 comments on commit bbd005c

Please sign in to comment.