Class: HasHelpers::DN::Processor

Inherits:
Object
  • Object
show all
Includes:
Utils::QueryUtils
Defined in:
app/lib/has_helpers/dn/processor.rb

Constant Summary collapse

MAX_PROCESSING_TIME =
5.minutes

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::QueryUtils

#fetch_update_info, #update_assoc, #update_intermediate_of_many_to_many, #update_many_to_many, #update_many_to_one, #update_one_to_many, #update_one_to_one, #update_sql, #update_table

Constructor Details

#initialize(table_name, columns_and_tables_to_update, class_name, record_id, changes, change_log_id) ⇒ Processor

Returns a new instance of Processor.



11
12
13
14
15
16
17
18
# File 'app/lib/has_helpers/dn/processor.rb', line 11

def initialize(table_name, columns_and_tables_to_update, class_name, record_id, changes, change_log_id)
  @table_name = table_name
  @changes = changes
  @columns_and_tables_to_update = columns_and_tables_to_update
  @record_id = record_id
  @class_name = class_name.constantize
  @change_log_id = change_log_id
end

Instance Attribute Details

#change_log_idObject (readonly)

Returns the value of attribute change_log_id.



9
10
11
# File 'app/lib/has_helpers/dn/processor.rb', line 9

def change_log_id
  @change_log_id
end

#changesObject (readonly)

Returns the value of attribute changes.



9
10
11
# File 'app/lib/has_helpers/dn/processor.rb', line 9

def changes
  @changes
end

#class_nameObject (readonly)

Returns the value of attribute class_name.



9
10
11
# File 'app/lib/has_helpers/dn/processor.rb', line 9

def class_name
  @class_name
end

#columns_and_tables_to_updateObject (readonly)

Returns the value of attribute columns_and_tables_to_update.



9
10
11
# File 'app/lib/has_helpers/dn/processor.rb', line 9

def columns_and_tables_to_update
  @columns_and_tables_to_update
end

#record_idObject (readonly)

Returns the value of attribute record_id.



9
10
11
# File 'app/lib/has_helpers/dn/processor.rb', line 9

def record_id
  @record_id
end

#table_nameObject (readonly)

Returns the value of attribute table_name.



9
10
11
# File 'app/lib/has_helpers/dn/processor.rb', line 9

def table_name
  @table_name
end

Instance Method Details

#processObject



20
21
22
# File 'app/lib/has_helpers/dn/processor.rb', line 20

def process
  process_upsert
end