diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-19 12:08:42 +0300 |
commit | b76ae638462ab0f673e5915986070518dd3f9ad3 (patch) | |
tree | bdab0533383b52873be0ec0eb4d3c66598ff8b91 /spec/lib/gitlab/sql/recursive_cte_spec.rb | |
parent | 434373eabe7b4be9593d18a585fb763f1e5f1a6f (diff) |
Add latest changes from gitlab-org/gitlab@14-2-stable-eev14.2.0-rc42
Diffstat (limited to 'spec/lib/gitlab/sql/recursive_cte_spec.rb')
-rw-r--r-- | spec/lib/gitlab/sql/recursive_cte_spec.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/lib/gitlab/sql/recursive_cte_spec.rb b/spec/lib/gitlab/sql/recursive_cte_spec.rb index edcacd404c2..f78c4a0cc02 100644 --- a/spec/lib/gitlab/sql/recursive_cte_spec.rb +++ b/spec/lib/gitlab/sql/recursive_cte_spec.rb @@ -14,9 +14,9 @@ RSpec.describe Gitlab::SQL::RecursiveCTE do cte << rel2 sql = cte.to_arel.to_sql - name = ActiveRecord::Base.connection.quote_table_name(:cte_name) + name = ApplicationRecord.connection.quote_table_name(:cte_name) - sql1, sql2 = ActiveRecord::Base.connection.unprepared_statement do + sql1, sql2 = ApplicationRecord.connection.unprepared_statement do [rel1.except(:order).to_sql, rel2.except(:order).to_sql] end @@ -28,8 +28,8 @@ RSpec.describe Gitlab::SQL::RecursiveCTE do it 'returns an alias for the CTE' do table = Arel::Table.new(:kittens) - source_name = ActiveRecord::Base.connection.quote_table_name(:cte_name) - alias_name = ActiveRecord::Base.connection.quote_table_name(:kittens) + source_name = ApplicationRecord.connection.quote_table_name(:cte_name) + alias_name = ApplicationRecord.connection.quote_table_name(:kittens) expect(cte.alias_to(table).to_sql).to eq("#{source_name} AS #{alias_name}") end @@ -37,8 +37,8 @@ RSpec.describe Gitlab::SQL::RecursiveCTE do it 'replaces dots with an underscore' do table = Arel::Table.new('gitlab.kittens') - source_name = ActiveRecord::Base.connection.quote_table_name(:cte_name) - alias_name = ActiveRecord::Base.connection.quote_table_name(:gitlab_kittens) + source_name = ApplicationRecord.connection.quote_table_name(:cte_name) + alias_name = ApplicationRecord.connection.quote_table_name(:gitlab_kittens) expect(cte.alias_to(table).to_sql).to eq("#{source_name} AS #{alias_name}") end |