Force update, also if no other attribute has changed.
This commit is contained in:
parent
8861541f44
commit
b75724450b
2 changed files with 5 additions and 1 deletions
|
@ -113,7 +113,10 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# check if entry exists / only if write action
|
# check if entry exists / only if write action
|
||||||
return if request.method == 'GET' || request.method == 'OPTIONS'
|
method = request.method
|
||||||
|
return if method == 'GET'
|
||||||
|
return if method == 'OPTIONS'
|
||||||
|
return if method == 'HEAD'
|
||||||
|
|
||||||
# only update if needed
|
# only update if needed
|
||||||
return if session[:user_device_update_at] && session[:user_device_update_at] > Time.zone.now - 5.minutes
|
return if session[:user_device_update_at] && session[:user_device_update_at] > Time.zone.now - 5.minutes
|
||||||
|
|
|
@ -145,6 +145,7 @@ log user device action
|
||||||
end
|
end
|
||||||
|
|
||||||
# update attributes
|
# update attributes
|
||||||
|
user_device.updated_at = Time.zone.now # force update, also if no other attribute has changed
|
||||||
user_device.save
|
user_device.save
|
||||||
user_device
|
user_device
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue