default member scope to filter unconfirmed

This commit is contained in:
2023-01-28 23:22:24 +02:00
parent eeb85d59f4
commit 5213cbce3b
2 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,8 @@
class Member < ApplicationRecord
def self.default_scope
where.not(confirmed_at: nil).where.not(picture: nil)
end
# Include default devise modules. Others available are:
# , :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,:confirmable,
@ -8,7 +12,7 @@ class Member < ApplicationRecord
has_many :stories
has_many :stories
has_many :pictures
validates :bio, length: { maximum: 1000 }
validates :name , length: { minimum: 3 }