diff options
| author | Zog | 2018-04-24 09:04:13 +0200 | 
|---|---|---|
| committer | Johan Van Ryseghem | 2018-04-25 15:46:33 +0200 | 
| commit | c3e6817f2cb2e35c90434574efac256d62636830 (patch) | |
| tree | 9f73835363786994539c637123366d60013d58d7 /app/models/application_model.rb | |
| parent | f838c165685972992d1ee7f597c9d94662099d89 (diff) | |
| download | chouette-core-c3e6817f2cb2e35c90434574efac256d62636830.tar.bz2 | |
Refs #6669; Fix CustomField initialization
Use the current referential to infer the workgroup
Diffstat (limited to 'app/models/application_model.rb')
| -rw-r--r-- | app/models/application_model.rb | 16 | 
1 files changed, 16 insertions, 0 deletions
| diff --git a/app/models/application_model.rb b/app/models/application_model.rb index 1a2a5099d..1715e06c4 100644 --- a/app/models/application_model.rb +++ b/app/models/application_model.rb @@ -2,4 +2,20 @@ class ApplicationModel < ::ActiveRecord::Base    include MetadataSupport    self.abstract_class = true + +  def self.referential +    Referential.where(slug: Apartment::Tenant.current).last +  end + +  def referential +    self.class.referential +  end + +  def self.workgroup +    referential&.workgroup +  end + +  def workgroup +    self.class.workgroup +  end  end | 
