Skip to content

Commit b207c19

Browse files
authored
Add Rails 7.2 to matrix (#149)
https://github.com/rails/rails/releases/tag/v7.2.0 Changes: - Send the connection's pool to `ActiveRecord::SchemaDumper.dump` for Rails 7.2 and above.
1 parent 0047d20 commit b207c19

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
fail-fast: false
1616
matrix:
1717
ruby: ["3.0", "3.1", "3.2", "3.3"]
18-
rails: ["6.1", "7.0", "7.1"]
18+
rails: ["6.1", "7.0", "7.1", "7.2"]
1919
continue-on-error: [false]
2020

2121
services:

spec/fx/schema_dumper_spec.rb

+12-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
stream = StringIO.new
1616
output = stream.string
1717

18-
ActiveRecord::SchemaDumper.dump(connection, stream)
18+
dump(connection: connection, stream: stream)
1919

2020
expect(output).to match(
2121
/table "my_table".*function :my_function.*RETURN 'test';/m
@@ -37,7 +37,7 @@
3737
stream = StringIO.new
3838
output = stream.string
3939

40-
ActiveRecord::SchemaDumper.dump(connection, stream)
40+
dump(connection: connection, stream: stream)
4141

4242
expect(output).to(
4343
match(/function :my_function.*RETURN 'test';.*table "my_table"/m)
@@ -68,7 +68,7 @@
6868
connection.execute aggregate_sql_definition
6969
stream = StringIO.new
7070

71-
ActiveRecord::SchemaDumper.dump(connection, stream)
71+
dump(connection: connection, stream: stream)
7272

7373
output = stream.string
7474
expect(output).to include("create_function :test, sql_definition: <<-'SQL'")
@@ -105,11 +105,19 @@
105105
)
106106
stream = StringIO.new
107107

108-
ActiveRecord::SchemaDumper.dump(connection, stream)
108+
dump(connection: connection, stream: stream)
109109

110110
output = stream.string
111111
expect(output).to include("create_trigger :uppercase_users_name")
112112
expect(output).to include("sql_definition: <<-SQL")
113113
expect(output).to include("EXECUTE FUNCTION uppercase_users_name()")
114114
end
115+
116+
def dump(connection:, stream:)
117+
if Rails.version >= "7.2"
118+
ActiveRecord::SchemaDumper.dump(connection.pool, stream)
119+
else
120+
ActiveRecord::SchemaDumper.dump(connection, stream)
121+
end
122+
end
115123
end

0 commit comments

Comments
 (0)