From 1f22aadf4f631da18c93ad3b493a33b6b677159c Mon Sep 17 00:00:00 2001 From: michaelalves204 Date: Mon, 28 Oct 2024 19:18:38 -0300 Subject: [PATCH] fix: alias_method_chain --- lib/foreigner/connection_adapters/abstract/table.rb | 7 ++++--- lib/foreigner/schema_dumper.rb | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/foreigner/connection_adapters/abstract/table.rb b/lib/foreigner/connection_adapters/abstract/table.rb index ec29b0a..fd51319 100644 --- a/lib/foreigner/connection_adapters/abstract/table.rb +++ b/lib/foreigner/connection_adapters/abstract/table.rb @@ -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 @@ -56,4 +57,4 @@ def references_with_foreign_keys(*args) end end end -end \ No newline at end of file +end diff --git a/lib/foreigner/schema_dumper.rb b/lib/foreigner/schema_dumper.rb index 99b9968..4f513b8 100644 --- a/lib/foreigner/schema_dumper.rb +++ b/lib/foreigner/schema_dumper.rb @@ -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