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 ...@@ -62,11 +62,11 @@ class Communication::Block < ApplicationRecord
after_commit :save_and_sync_about, on: [:update, :destroy] after_commit :save_and_sync_about, on: [:update, :destroy]
def data=(value) def data=(value)
attributes['data'] = template.parse(value).to_json attributes['data'] = template.parse(value).to_h
end end
def data def data
template.to_json template.to_h
end end
def git_dependencies def git_dependencies
......
...@@ -6,12 +6,12 @@ class Communication::Block::Component::Base ...@@ -6,12 +6,12 @@ class Communication::Block::Component::Base
@template = template @template = template
end end
def value def data
data[property] data[property]
end end
def value=(v) def data=(value)
data[property] = v data[property] = value
end end
def data def data
......
...@@ -36,11 +36,11 @@ class Communication::Block::Template::Base ...@@ -36,11 +36,11 @@ class Communication::Block::Template::Base
sanitizer_type = sanitizers[kind] sanitizer_type = sanitizers[kind]
class_eval <<-CODE, __FILE__, __LINE__ + 1 class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{property} def #{property}
Communication::Block::Component::#{kind.classify}.new(property, self).value Communication::Block::Component::#{kind.classify}.new(property, self).data
end end
def #{property}=(value) def #{property}=(value)
Communication::Block::Component::#{kind.classify}.new(property, self).value = value Communication::Block::Component::#{kind.classify}.new(property, self).data = value
end end
CODE CODE
end 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