Skip to content
Snippets Groups Projects
Commit 04e4b6b0 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

wip

parent 2272f9b4
No related branches found
No related tags found
No related merge requests found
......@@ -62,11 +62,11 @@ class Communication::Block < ApplicationRecord
after_commit :save_and_sync_about, on: [:update, :destroy]
def data=(value)
attributes['data'] = template.parse(value).to_json
attributes['data'] = template.parse(value).to_h
end
def data
template.to_json
template.to_h
end
def git_dependencies
......
......@@ -6,12 +6,12 @@ class Communication::Block::Component::Base
@template = template
end
def value
def data
data[property]
end
def value=(v)
data[property] = v
def data=(value)
data[property] = value
end
def data
......
......@@ -36,11 +36,11 @@ class Communication::Block::Template::Base
sanitizer_type = sanitizers[kind]
class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{property}
Communication::Block::Component::#{kind.classify}.new(property, self).value
Communication::Block::Component::#{kind.classify}.new(property, self).data
end
def #{property}=(value)
Communication::Block::Component::#{kind.classify}.new(property, self).value = value
Communication::Block::Component::#{kind.classify}.new(property, self).data = value
end
CODE
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment