Chatwoot/app/fields/serialized_field.rb

16 lines
223 B
Ruby
Raw Permalink Normal View History

require 'administrate/field/base'
class SerializedField < Administrate::Field::Base
def to_s
hash? ? data.as_json : data.to_s
end
def hash?
data.is_a? Hash
end
def array?
data.is_a? Array
end
end