Module: Sequent::Core::SerializesEvent::ClassMethods

Defined in:
lib/sequent/core/event_record.rb

Instance Method Summary collapse

Instance Method Details

#serialize_json?Boolean

Returns:



69
70
71
72
73
74
# File 'lib/sequent/core/event_record.rb', line 69

def serialize_json?
  return true unless respond_to? :columns_hash

  json_column_type = columns_hash['event_json']..type
  %i[json jsonb].exclude? json_column_type
end

#serialize_to_json(event) ⇒ Object



65
66
67
# File 'lib/sequent/core/event_record.rb', line 65

def serialize_to_json(event)
  Sequent::Core::Oj.dump(event)
end