提交 2f36c988 编写于 作者: R Rafael França 提交者: GitHub

Merge pull request #29604 from kamipo/fix_ids_reader_to_respect_case_sensitive_pk

Fix `ids_reader` to respect case sensitive primary key
......@@ -44,10 +44,7 @@ def ids_reader
if loaded?
target.pluck(reflection.association_primary_key)
else
@association_ids ||= (
column = "#{reflection.quoted_table_name}.#{reflection.association_primary_key}"
scope.pluck(column)
)
@association_ids ||= scope.pluck(reflection.association_primary_key)
end
end
......
......@@ -107,7 +107,7 @@
t.boolean :has_fun, null: false, default: false
end
create_table :bulbs, force: true do |t|
create_table :bulbs, primary_key: "ID", force: true do |t|
t.integer :car_id
t.string :name
t.boolean :frickinawesome, default: false
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册