diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-07-15 13:47:08 -0500 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-07-15 14:12:24 -0500 |
commit | 436f7984d9ea60ec0dc222fcbcaa795792942781 (patch) | |
tree | d21f26779ed8fe1a7efee820cce07338db9f317a /app/models/account.rb | |
parent | 9a2f0131c6cddef3ef0e7faa73070945f0d4f452 (diff) |
move user variables to `users` relation
Diffstat (limited to 'app/models/account.rb')
-rw-r--r-- | app/models/account.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/models/account.rb b/app/models/account.rb index 8187bc7d9..d30c2a9ec 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -313,6 +313,10 @@ class Account < ApplicationRecord self[:also_known_as] || [] end + def field + @field ||= fields.map { |f| [f.name, f.value] }.to_h + end + def fields (self[:fields] || []).map { |f| Field.new(self, f) } end @@ -352,6 +356,7 @@ class Account < ApplicationRecord self.fields = tmp end + # needs to be removed after migration def vars self[:vars] end |