Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/foreigner/connection_adapters/abstract/table.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module Foreigner
module ConnectionAdapters
module ConnectionAdapters
module Table
extend ActiveSupport::Concern

included do
alias_method_chain :references, :foreign_keys
alias_method :references_without_foreign_keys, :references
alias_method :references, :references_with_foreign_keys
end

# Adds a new foreign key to the table. +to_table+ can be a single Symbol, or
Expand Down Expand Up @@ -56,4 +57,4 @@ def references_with_foreign_keys(*args)
end
end
end
end
end
3 changes: 2 additions & 1 deletion lib/foreigner/schema_dumper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ module SchemaDumper
extend ActiveSupport::Concern

included do
alias_method_chain :tables, :foreign_keys
alias_method :tables_without_foreign_keys, :tables
alias_method :tables, :tables_with_foreign_keys
end

module ClassMethods
Expand Down