Show More
Commit Description:
add heart_beat
Commit Description:
add heart_beat
References:
File last commit:
Show/Diff file:
Action:
app/controllers/heartbeat_controller.rb
| 14 lines
| 367 B
| text/x-ruby
| RubyLexer
|
r533 | class HeartbeatController < ApplicationController | |||
def edit | ||||
render layout: 'empty' | ||||
@user = User.find_by_login(params[:id]) | ||||
return unless @user | ||||
hb = HeartBeat.where(user_id: @user.id, ip_address: request.remote_ip).first | ||||
if hb | ||||
hb.touch | ||||
else | ||||
HeartBeat.create(user_id: @user.id, ip_address: request.remote_ip) | ||||
end | ||||
end | ||||
end | ||||