aboutsummaryrefslogtreecommitdiff
path: root/app/models/resource.rb
diff options
context:
space:
mode:
authorNemael <100dragons@gmail.com>2021-02-12 16:43:53 +0100
committerNemael <100dragons@gmail.com>2021-02-12 16:43:53 +0100
commit5c32c4a5c979be4784ccdbeb235aed73c920d05e (patch)
tree05c260c4c9feeff2300fe5efe03c2ea402db73cc /app/models/resource.rb
parent40effe28304cf183f6a1a05e15ac981b1dee4335 (diff)
parentc1c920585581d189e9d98e1e20c39d689469c5b2 (diff)
downloadincommon-map-5c32c4a5c979be4784ccdbeb235aed73c920d05e.tar.gz
Merge branch 'import' of code.cepheide.org:incommon-map into importimport
Diffstat (limited to 'app/models/resource.rb')
-rw-r--r--app/models/resource.rb5
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