Use Date.current and Time.current

Using Date.today and Time.now might lead to inconsistencies if the time
zone the application uses is not the same as the system time zone.
This commit is contained in:
Javi Martín
2019-06-18 01:15:06 +02:00
parent 158f59ce0d
commit a21240b230
20 changed files with 34 additions and 34 deletions

View File

@@ -39,7 +39,7 @@ section "Creating Proposals" do
geozone: Geozone.all.sample,
skip_map: "1",
terms_of_service: "1",
published_at: Time.now)
published_at: Time.current)
random_locales.map do |locale|
Globalize.with_locale(locale) do
proposal.title = "Title for locale #{locale}"
@@ -97,7 +97,7 @@ section "Creating Successful Proposals" do
skip_map: "1",
terms_of_service: "1",
cached_votes_up: Setting["votes_for_proposal_success"],
published_at: Time.now)
published_at: Time.current)
random_locales.map do |locale|
Globalize.with_locale(locale) do
proposal.title = "Successful proposal title for locale #{locale}"
@@ -123,7 +123,7 @@ section "Creating Successful Proposals" do
geozone: Geozone.all.sample,
skip_map: "1",
terms_of_service: "1",
published_at: Time.now)
published_at: Time.current)
random_locales.map do |locale|
Globalize.with_locale(locale) do
proposal.title = "Tagged proposal title for locale #{locale}"