Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ jobs:
strategy:
matrix:
ruby-version:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
- '3.3'
- '3.4'
services:
postgres:
image: postgres:13
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

source "https://rubygems.org"

gem "activerecord", "~>7.0.8"
gem "activerecord", "~>7.1.5"
gem "mysql2"
gem "pg"
gem "sqlite3", "< 2"
Expand Down
6 changes: 2 additions & 4 deletions lib/active_record/virtual_attributes/virtual_delegates.rb
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,9 @@ def self.select_from_alias(to_ref, col, to_model_col_name, src_model_id)
def self.select_from_alias_table(to_klass, src_relation)
to_table = to_klass.arel_table
# if a self join, alias the second table to a different name
if to_table.table_name == src_relation.table_name
# use a dup to not modify the primary table in the model
to_table = to_table.dup
if to_table.name == src_relation.name
# use a table alias to not conflict with table name in the primary query
to_table.table_alias = "#{to_table.table_name}_sub"
to_table = to_table.alias("#{to_table.name}_sub")
end
to_table
end
Expand Down