Skip to content
Snippets Groups Projects
Unverified Commit 99470758 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

blocks fields class attr

parent efb68d7f
No related branches found
No related tags found
No related merge requests found
class Communication::Block::Template
class_attribute :fields
attr_reader :block
def self.has_rich_text(property)
......@@ -10,6 +12,9 @@ class Communication::Block::Template
end
def self.has_field(property, kind)
self.fields ||= []
self.fields << { name: property, type: kind }
class_eval <<-CODE, __FILE__, __LINE__ + 1
def #{property}
data[:#{property}]
......
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