module TurboTest::StaticAnalysis::ActiveRecord

Constants

Diff
Map
Snapshot

Public Class Methods

schema_changes(new_schema, old_schema) click to toggle source
# File lib/turbo_test_static_analysis/active_record_schema.rb, line 16
def schema_changes(new_schema, old_schema)
  current_snapshot = SexpBuilder.snapshot_from_source(new_schema)
  previous_snapshot = SexpBuilder.snapshot_from_source(old_schema)
  changes = DiffCompute.new(current_snapshot, previous_snapshot).calc
  {
    extensions: changes[:extensions].to_h,
    tables: changes[:tables].to_h
  }
end