diff options
author | Nemael <100dragons@gmail.com> | 2021-02-12 16:43:53 +0100 |
---|---|---|
committer | Nemael <100dragons@gmail.com> | 2021-02-12 16:43:53 +0100 |
commit | 5c32c4a5c979be4784ccdbeb235aed73c920d05e (patch) | |
tree | 05c260c4c9feeff2300fe5efe03c2ea402db73cc /app | |
parent | 40effe28304cf183f6a1a05e15ac981b1dee4335 (diff) | |
parent | c1c920585581d189e9d98e1e20c39d689469c5b2 (diff) | |
download | incommon-map-import.tar.gz |
Merge branch 'import' of code.cepheide.org:incommon-map into importimport
Diffstat (limited to 'app')
-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 |