Class: TurboTest::StaticAnalysis::ActiveRecord::DiffCompute

Inherits:
Object
  • Object
show all
Defined in:
lib/turbo_test_static_analysis/active_record_schema/diff_compute.rb

Instance Method Summary collapse

Constructor Details

#initialize(new_snapshot, old_snapshot) ⇒ DiffCompute

Returns a new instance of DiffCompute.



7
8
9
# File 'lib/turbo_test_static_analysis/active_record_schema/diff_compute.rb', line 7

def initialize(new_snapshot, old_snapshot)
  @data = { new: new_snapshot, old: old_snapshot }
end

Instance Method Details

#calcObject



11
12
13
14
15
16
# File 'lib/turbo_test_static_analysis/active_record_schema/diff_compute.rb', line 11

def calc
  empty_diff.tap do |diff|
    compute(:extensions, diff[:extensions])
    compute(:tables, diff[:tables])
  end
end