Skip to content

Commit

Permalink
tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mival authored and shioyama committed Mar 20, 2024
1 parent c014e86 commit 7796c86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mobility/backends/active_record/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def configure(options)
options[:subclass_name] ||= :Translation
end
%i[foreign_key association_name subclass_name table_name].each { |key|
if options[key].is_a?(Array)
if options[key].is_a?(Enumerable)
options[key] = options[key].map!(&:to_sym)
else
options[key] = options[key].to_sym
Expand Down
2 changes: 1 addition & 1 deletion spec/mobility/backends/active_record/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@
end

it "sets composite foreign_key" do
backend_class.configure(options)
backend_class.configure(options.merge!(foreign_key: [:article_id, :article_type]))
expect(options[:foreign_key]).to eq([:article_id, :article_type])
end
end
Expand Down

0 comments on commit 7796c86

Please sign in to comment.