|
|
|
@ -4,13 +4,12 @@ class Organisation < ApplicationRecord
|
|
|
|
|
has_many :managed_case_logs, class_name: "CaseLog", foreign_key: "managing_organisation_id" |
|
|
|
|
|
|
|
|
|
include DbEnums |
|
|
|
|
enum providertype: DbEnums.providertype, _suffix: true |
|
|
|
|
enum org_type: DbEnums.org_type, _suffix: true |
|
|
|
|
|
|
|
|
|
def case_logs |
|
|
|
|
CaseLog.for_organisation(self) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def completed_case_logs |
|
|
|
|
case_logs.completed |
|
|
|
|
end |
|
|
|
@ -28,7 +27,7 @@ class Organisation < ApplicationRecord
|
|
|
|
|
name: name, |
|
|
|
|
address: address_string, |
|
|
|
|
telephone_number: phone, |
|
|
|
|
type: providertype, |
|
|
|
|
type: org_type, |
|
|
|
|
local_authorities_operated_in: local_authorities, |
|
|
|
|
holds_own_stock: holds_own_stock, |
|
|
|
|
other_stock_owners: other_stock_owners, |
|
|
|
|