18 19 20 21 22 23 24
# File 'lib/evently/event.rb', line 18 def self.serialize_and_initialize(obj) if obj.is_a?(Mongoid::Document) EventPart.new(content: { name: obj.name, class_name: obj.class.name, id: obj.id.to_s }) else EventPart.new(content: obj) end end