default member scope to filter unconfirmed
This commit is contained in:
@ -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 }
|
||||
|
||||
|
Reference in New Issue
Block a user