Files
vault171/app/models/session.rb
David Böhm 6f192274ab
Some checks failed
CI / scan_ruby (push) Has been cancelled
CI / scan_js (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / test (push) Has been cancelled
CI / system-test (push) Has been cancelled
Big first commit
authentication-zero and first layout
2026-05-21 02:54:39 +02:00

12 lines
287 B
Ruby

class Session < ApplicationRecord
belongs_to :user
before_create do
self.user_agent = Current.user_agent
self.ip_address = Current.ip_address
end
after_create { user.events.create! action: "signed_in" }
after_destroy { user.events.create! action: "signed_out" }
end