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

@@ -12,7 +12,7 @@ class Dashboard::ActionsController < Dashboard::BaseController
source_params = {
proposal: proposal,
action: dashboard_action,
executed_at: Time.now
executed_at: Time.current
}
@dashboard_executed_action = Dashboard::ExecutedAction.new(source_params)
@@ -31,7 +31,7 @@ class Dashboard::ActionsController < Dashboard::BaseController
authorize! :dashboard, proposal
Dashboard::ExecutedAction.create(proposal: proposal, action: dashboard_action,
executed_at: Time.now)
executed_at: Time.current)
redirect_to request.referer
end