Generated authentication

This commit is contained in:
2025-06-21 23:26:05 +03:00
parent c2920708ab
commit 02be5a53d6
20 changed files with 210 additions and 1 deletions
+4
View File
@@ -0,0 +1,4 @@
class Current < ActiveSupport::CurrentAttributes
attribute :session
delegate :user, to: :session, allow_nil: true
end
+3
View File
@@ -0,0 +1,3 @@
class Session < ApplicationRecord
belongs_to :user
end
+6
View File
@@ -0,0 +1,6 @@
class User < ApplicationRecord
has_secure_password
has_many :sessions, dependent: :destroy
normalizes :email_address, with: ->(e) { e.strip.downcase }
end