User: add active scope

This commit is contained in:
Carl Chenet 2017-05-23 13:43:36 +02:00
parent 517f62c886
commit 8fe01e7e2c
1 changed files with 2 additions and 0 deletions

View File

@ -69,6 +69,8 @@ class User < ActiveRecord::Base
end
end
scope :active, -> { where(:banned_at => nil, :deleted_at => nil) }
before_save :check_session_token
before_validation :on => :create do
self.create_rss_token