Skip to content

Commit 7ca0e13

Browse files
authored
Merge pull request #168 from jrafanie/rails71
Rails 7.1 support
2 parents 7dcdcb1 + defbba0 commit 7ca0e13

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

.github/workflows/ci.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ jobs:
1212
strategy:
1313
matrix:
1414
ruby-version:
15-
- '2.7'
16-
- '3.0'
1715
- '3.1'
16+
- '3.2'
17+
- '3.3'
18+
- '3.4'
1819
services:
1920
postgres:
2021
image: postgres:13

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
source "https://rubygems.org"
44

5-
gem "activerecord", "~>7.0.8"
5+
gem "activerecord", "~>7.1.5"
66
gem "mysql2"
77
gem "pg"
88
gem "sqlite3", "< 2"

lib/active_record/virtual_attributes/virtual_delegates.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -271,11 +271,9 @@ def self.select_from_alias(to_ref, col, to_model_col_name, src_model_id)
271271
def self.select_from_alias_table(to_klass, src_relation)
272272
to_table = to_klass.arel_table
273273
# if a self join, alias the second table to a different name
274-
if to_table.table_name == src_relation.table_name
275-
# use a dup to not modify the primary table in the model
276-
to_table = to_table.dup
274+
if to_table.name == src_relation.name
277275
# use a table alias to not conflict with table name in the primary query
278-
to_table.table_alias = "#{to_table.table_name}_sub"
276+
to_table = to_table.alias("#{to_table.name}_sub")
279277
end
280278
to_table
281279
end

0 commit comments

Comments
 (0)