default member scope to filter unconfirmed

This commit is contained in:
Torsten
2023-01-28 23:22:16 +02:00
parent 4278b55e22
commit 3df2618315
3 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,9 @@
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 +13,7 @@ class Member < ApplicationRecord
has_many :stories
has_many :stories
has_many :pictures
validates :bio, length: { maximum: 1000 }
validates :name , length: { minimum: 3 }