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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user