Class: Datamappify::Data::Criteria::Sequel::Destroy

Inherits:
Common
  • Object
show all
Defined in:
lib/datamappify/data/criteria/sequel/destroy.rb

Instance Attribute Summary

Attributes inherited from Common

#attributes, #attributes_and_values, #criteria, #entity, #options, #source_class

Instance Method Summary collapse

Methods inherited from Common

#any_attribute, #default_source_class_name, #ignore?, #ignore_attribute?, #key_name, #key_value, #new_record?, #perform_with_callbacks, #pk, #primary_record?, #store_attribute_value

Constructor Details

#initialize(source_class, id) ⇒ Destroy

Returns a new instance of Destroy.



6
7
8
# File 'lib/datamappify/data/criteria/sequel/destroy.rb', line 6

def initialize(source_class, id)
  super(source_class, nil, id)
end

Instance Method Details

#performObject



10
11
12
# File 'lib/datamappify/data/criteria/sequel/destroy.rb', line 10

def perform
  source_class.where(:id => criteria).destroy
end