Commit 6421bb70 by ivan Lan

Add :meta_column to module JsonColumn

parent 75f6195a
...@@ -109,9 +109,11 @@ module Shotengai ...@@ -109,9 +109,11 @@ module Shotengai
} }
end end
# TODO:ORNOT: def meta_column column, default: nil, trans: Proc.new(&:itself)
def hash_column # json column using for code development
# like meta, detail these json using for code development define_method(:meta) { super() || {} }
define_method(column) { trans.call(meta[column.to_s] || default) }
define_method("#{column}=") { |val| self.meta = meta.merge(column.to_s => val) }
end end
# def custom_hash_columns columns, options={} # def custom_hash_columns columns, options={}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment