Skip to content

Commit

Permalink
Add test for handling schema name in table_name
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Nov 30, 2024
1 parent fae2278 commit 6398256
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/mobility/backends/active_record/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6398256

Please sign in to comment.