debian-mirror-gitlab/app/models/concerns/as_cte.rb
2022-07-29 14:03:07 +02:00

12 lines
248 B
Ruby

# frozen_string_literal: true
# Convert any ActiveRecord::Relation to a Gitlab::SQL::CTE
module AsCte
extend ActiveSupport::Concern
class_methods do
def as_cte(name, **opts)
Gitlab::SQL::CTE.new(name, all, **opts)
end
end
end