Class: DeploymentMergeRequest
Constant Summary
ApplicationRecord::MAX_PLUCK
HasCheckConstraints::NOT_NULL_CHECK_PATTERN
ResetOnColumnErrors::MAX_RESET_PERIOD
Class Method Summary
collapse
===, cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, nullable_column?, pluck_primary_key, primary_key_in, #readable_by?, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, #to_ability_name, underscore, where_exists, where_not_exists, with_fast_read_statement_timeout, without_order
#reset_on_union_error, #reset_on_unknown_attribute_error
#serializable_hash
Class Method Details
.by_deployment_id(id) ⇒ Object
14
15
16
|
# File 'app/models/deployment_merge_request.rb', line 14
def self.by_deployment_id(id)
where(deployments: { id: id })
end
|
.deployed_after(time) ⇒ Object
27
28
29
|
# File 'app/models/deployment_merge_request.rb', line 27
def self.deployed_after(time)
where('deployments.finished_at > ?', time)
end
|
.deployed_before(time) ⇒ Object
31
32
33
|
# File 'app/models/deployment_merge_request.rb', line 31
def self.deployed_before(time)
where('deployments.finished_at < ?', time)
end
|
.deployed_to(name) ⇒ Object
18
19
20
21
22
23
24
25
|
# File 'app/models/deployment_merge_request.rb', line 18
def self.deployed_to(name)
where(environments: { name: name })
.where('environments.project_id = merge_requests.target_project_id')
end
|
.join_deployments_for_merge_requests ⇒ Object
9
10
11
12
|
# File 'app/models/deployment_merge_request.rb', line 9
def self.join_deployments_for_merge_requests
joins(deployment: :environment)
.where('deployment_merge_requests.merge_request_id = merge_requests.id')
end
|