Method: DataBroker::Mapper::InstanceMethods#destroy

Defined in:
lib/data_broker/mapper.rb

#destroy(model, eager_load: false) ⇒ Object



101
102
103
104
105
106
107
108
# File 'lib/data_broker/mapper.rb', line 101

def destroy(model, eager_load: false)
  record = self.eager_record(eager_load).find_by(:id => model.id)
  if record.nil?
    nil
  else
    records_to_objects(record.destroy, :eager_load => false).first
  end
end