Class: Graphiti::SchemaDiff

Inherits:
Object show all
Defined in:
lib/graphiti/schema_diff.rb

Instance Method Summary collapse

Constructor Details

#initialize(old, new) ⇒ SchemaDiff

Returns a new instance of SchemaDiff.



3
4
5
6
7
# File 'lib/graphiti/schema_diff.rb', line 3

def initialize(old, new)
  @old = JSON.parse(old.to_json).deep_symbolize_keys
  @new = JSON.parse(new.to_json).deep_symbolize_keys
  @errors = []
end

Instance Method Details

#compareObject



9
10
11
12
# File 'lib/graphiti/schema_diff.rb', line 9

def compare
  compare_each if @old != @new
  @errors
end