未验证 提交 b802e082 编写于 作者: R Ryuta Kamizono 提交者: GitHub

Merge pull request #34626 from gmcgibbon/sqlite_pluck_quoting

Fix join table column quoting with SQLite.
* Fix join table column quoting with SQLite.
*Gannon McGibbon*
* Allow disabling scopes generated by `ActiveRecord.enum`.
*Alfred Dominic*
......
......@@ -12,6 +12,10 @@ def quote_table_name_for_assignment(table, attr)
quote_column_name(attr)
end
def quote_table_name(name)
@quoted_table_names[name] ||= super.gsub(".", "\".\"").freeze
end
def quote_column_name(name)
@quoted_column_names[name] ||= %Q("#{super.gsub('"', '""')}")
end
......
......@@ -721,6 +721,10 @@ def test_pluck_with_includes_offset
assert_equal [], Topic.includes(:replies).order(:id).offset(5).pluck(:id)
end
def test_pluck_with_join
assert_equal [[2, 2], [4, 4]], Reply.includes(:topic).pluck(:id, :"topics.id")
end
def test_group_by_with_limit
expected = { "Post" => 8, "SpecialPost" => 1 }
actual = Post.includes(:comments).group(:type).order(:type).limit(2).count("comments.id")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册