Skip to content
Snippets Groups Projects

Introduce models for Receptive Agents (Part 1)

Merged Timo Furrer requested to merge receptive-agents/part-1/model into master
1 unresolved thread
Files
2
@@ -4,6 +4,7 @@ module Clusters
class Agent < ApplicationRecord
include FromUnion
include Gitlab::Utils::StrongMemoize
include IgnorableColumns
self.table_name = 'cluster_agents'
@@ -38,9 +39,7 @@ class Agent < ApplicationRecord
scope :with_name, ->(name) { where(name: name) }
scope :has_vulnerabilities, ->(value = true) { where(has_vulnerabilities: value) }
# NOTE: we are currently unable to use ignore_column because
# it's incompatible with functions in this model.
# ignore_column :connection_mode, remove_with: '17.6', remove_after: '2024-11-01'
ignore_column :connection_mode, remove_with: '17.6', remove_after: '2024-11-01'
validates :name,
presence: true,
@@ -94,7 +93,7 @@ def user_access_authorizations
self.class.from_union(
user_access_project_authorizations.select('config').limit(1),
user_access_group_authorizations.select('config').limit(1)
).compact.first
).select('config').compact.first
end
private
Loading