Submit social housing lettings and sales data (CORE)
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
class User < ApplicationRecord
|
|
|
|
# Include default devise modules. Others available are:
|
|
|
|
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
|
|
|
|
devise :database_authenticatable, :recoverable, :rememberable, :validatable
|
|
|
|
|
|
|
|
belongs_to :organisation
|
|
|
|
has_many :owned_case_logs, through: :organisation
|
|
|
|
has_many :managed_case_logs, through: :organisation
|
|
|
|
|
|
|
|
def case_logs
|
|
|
|
CaseLog.for_organisation(organisation)
|
|
|
|
end
|
|
|
|
|
|
|
|
def completed_case_logs
|
|
|
|
case_logs.completed
|
|
|
|
end
|
|
|
|
|
|
|
|
def not_completed_case_logs
|
|
|
|
case_logs.not_completed
|
|
|
|
end
|
|
|
|
end
|