From 639825688c5b37d322fc4486f2f7a8dcc40f246f Mon Sep 17 00:00:00 2001 From: Chris Salzberg Date: Sat, 30 Nov 2024 16:25:44 +0900 Subject: [PATCH] Add test for handling schema name in table_name --- spec/mobility/backends/active_record/table_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/mobility/backends/active_record/table_spec.rb b/spec/mobility/backends/active_record/table_spec.rb index a032157f..bce5846f 100644 --- a/spec/mobility/backends/active_record/table_spec.rb +++ b/spec/mobility/backends/active_record/table_spec.rb @@ -270,6 +270,12 @@ backend_class.configure(options.merge!(foreign_key: [:article_id, :article_type])) expect(options[:foreign_key]).to eq([:article_id, :article_type]) end + + it "strips out leading schema name from foreign key" do + Article.table_name = "my_schema.articles" + backend_class.configure(options) + expect(options[:foreign_key]).to eq(:article_id) + end end describe "with query plugin" do