Method: Masamune::Schema::Table#shared_columns

Defined in:
lib/masamune/schema/table.rb

#shared_columns(other) ⇒ Object



227
228
229
230
231
232
233
234
235
# File 'lib/masamune/schema/table.rb', line 227

def shared_columns(other)
  Hash.new { |h, k| h[k] = [] }.tap do |shared|
    columns.each do |_, column|
      other.columns.each do |_, other_column|
        shared[column] << other_column if column.references?(other_column)
      end
    end
  end
end