Fixed issue #2418 - Missing table name quoting causes MySQL 8 incompatibility.
This commit is contained in:
parent
b361b43836
commit
3d45432f78
2 changed files with 2 additions and 2 deletions
|
@ -134,7 +134,7 @@ returns
|
||||||
next if association_attributes_ignored.include?(assoc_name)
|
next if association_attributes_ignored.include?(assoc_name)
|
||||||
|
|
||||||
eager_load.push(assoc_name)
|
eager_load.push(assoc_name)
|
||||||
pluck.push("#{assoc.table_name}.id AS #{assoc_name}")
|
pluck.push("#{ActiveRecord::Base.connection.quote_table_name(assoc.table_name)}.id AS #{ActiveRecord::Base.connection.quote_table_name(assoc_name)}")
|
||||||
keys.push("#{assoc_name.to_s.singularize}_ids")
|
keys.push("#{assoc_name.to_s.singularize}_ids")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ module HasGroups
|
||||||
# @return [ActiveRecord::AssociationRelation<[<Group]>] List of Groups with :through attributes
|
# @return [ActiveRecord::AssociationRelation<[<Group]>] List of Groups with :through attributes
|
||||||
def access(*access)
|
def access(*access)
|
||||||
table_name = proxy_association.owner.class.group_through.table_name
|
table_name = proxy_association.owner.class.group_through.table_name
|
||||||
query = select("groups.*, #{table_name}.*")
|
query = select("#{ActiveRecord::Base.connection.quote_table_name('groups')}.*, #{ActiveRecord::Base.connection.quote_table_name(table_name)}.*")
|
||||||
return query if access.blank?
|
return query if access.blank?
|
||||||
|
|
||||||
access.push('full') if !access.include?('full')
|
access.push('full') if !access.include?('full')
|
||||||
|
|
Loading…
Reference in a new issue