aboutsummaryrefslogtreecommitdiff
path: root/app/models/user.rb
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2024-03-13 18:03:43 +0100
committerMiquel Sabaté Solà <msabate@suse.com>2024-03-13 18:03:43 +0100
commita7791635aa98f012d35f97c3c5288494bbb28e38 (patch)
treebad987e6b4d10ad2f7cd02e40658d464907595ee /app/models/user.rb
downloadoperum-a7791635aa98f012d35f97c3c5288494bbb28e38.tar.gz
operum-a7791635aa98f012d35f97c3c5288494bbb28e38.zip
Initial commit
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
new file mode 100644
index 0000000..7eaba55
--- /dev/null
+++ b/app/models/user.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class User < ApplicationRecord
+ has_secure_password
+
+ validates :username, presence: true, uniqueness: true
+ validates :password, presence: true, on: :create
+ validates :password_confirmation, presence: true, on: :create
+end