Class: DataAnon::Utils::BaseTable

Inherits:
Object
  • Object
show all
Defined in:
lib/utils/database.rb

Direct Known Subclasses

DestinationTable, SourceTable

Class Method Summary collapse

Class Method Details

.create_table(database, table_name, primary_keys = []) ⇒ Object


32
33
34
35
36
37
38
39
40
41
# File 'lib/utils/database.rb', line 32

def self.create_table  database, table_name, primary_keys = []
  Class.new(database) do
    self.table_name = table_name
    self.primary_keys = primary_keys if primary_keys.length > 1
    self.primary_key = primary_keys[0] if primary_keys.length == 1
    self.primary_key = nil if primary_keys.length == 0
    self.inheritance_column = :_type_disabled
    self.mass_assignment_sanitizer = MassAssignmentIgnoreSanitizer.new
  end
end