diff options
author | hellekin <hellekin@cepheide.org> | 2021-02-11 18:00:01 +0100 |
---|---|---|
committer | hellekin <hellekin@cepheide.org> | 2021-02-11 18:00:01 +0100 |
commit | c1c920585581d189e9d98e1e20c39d689469c5b2 (patch) | |
tree | 9f90dca9a7a4331052dcd0e3cbe7a255eef66aa0 /app/models | |
parent | cc8e259c14b7d5298c6fed6b53c9a41fcbf880de (diff) | |
download | incommon-map-c1c920585581d189e9d98e1e20c39d689469c5b2.tar.gz |
WTF
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/resource.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/models/resource.rb b/app/models/resource.rb index 8df106c..633258f 100644 --- a/app/models/resource.rb +++ b/app/models/resource.rb @@ -14,7 +14,7 @@ class Resource < ApplicationRecord store_accessor :feature, :geometry, :properties - validates_associated :agent + #validates_associated :agent validates :name, presence: true, @@ -62,8 +62,9 @@ class Resource < ApplicationRecord [:name, :summary, :description, :email, :source, :address, :postal_code, :city, :phone_number, :website].each do |prop| # Define a reader define_method prop do - properties[prop.to_s] + feature['properties'][prop.to_s] end + # Define a writer define_method :"#{prop}=" do |v| feature['properties'][prop.to_s] = v end |