aboutsummaryrefslogtreecommitdiff
path: root/app/models/resource.rb
diff options
context:
space:
mode:
authorhellekin <hellekin@cepheide.org>2021-02-11 18:00:01 +0100
committerhellekin <hellekin@cepheide.org>2021-02-11 18:00:01 +0100
commitc1c920585581d189e9d98e1e20c39d689469c5b2 (patch)
tree9f90dca9a7a4331052dcd0e3cbe7a255eef66aa0 /app/models/resource.rb
parentcc8e259c14b7d5298c6fed6b53c9a41fcbf880de (diff)
downloadincommon-map-c1c920585581d189e9d98e1e20c39d689469c5b2.tar.gz
WTF
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