Class: Ci::PipelineSchedule
Constant Summary
Constants included
from Limitable
Limitable::GLOBAL_SCOPE
ApplicationRecord::MAX_PLUCK
Instance Attribute Summary
Attributes included from Importable
#imported, #importing
Instance Method Summary
collapse
extended, extensions, included, method_added, override, prepended, queue_verification, verify!
#schedule_next_run!
#strip_attributes!
model_name, table_name_prefix
cached_column_list, #create_or_load_association, declarative_enum, default_select_columns, id_in, id_not_in, iid_in, 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
#serializable_hash
Instance Method Details
#daily_limit ⇒ Object
65
66
67
|
# File 'app/models/ci/pipeline_schedule.rb', line 65
def daily_limit
project.actual_limits.limit_for(:ci_daily_pipeline_schedule_triggers)
end
|
#deactivate! ⇒ Object
50
51
52
|
# File 'app/models/ci/pipeline_schedule.rb', line 50
def deactivate!
update_attribute(:active, false)
end
|
#for_tag? ⇒ Boolean
75
76
77
78
79
|
# File 'app/models/ci/pipeline_schedule.rb', line 75
def for_tag?
return false unless ref.present?
ref.start_with? 'refs/tags/'
end
|
#inactive? ⇒ Boolean
46
47
48
|
# File 'app/models/ci/pipeline_schedule.rb', line 46
def inactive?
!active?
end
|
#job_variables ⇒ Object
54
55
56
|
# File 'app/models/ci/pipeline_schedule.rb', line 54
def job_variables
variables&.map(&:to_runner_variable) || []
end
|
#own!(user) ⇒ Object
42
43
44
|
# File 'app/models/ci/pipeline_schedule.rb', line 42
def own!(user)
update(owner: user)
end
|
#owned_by?(current_user) ⇒ Boolean
38
39
40
|
# File 'app/models/ci/pipeline_schedule.rb', line 38
def owned_by?(current_user)
owner == current_user
end
|
#ref_for_display ⇒ Object
69
70
71
72
73
|
# File 'app/models/ci/pipeline_schedule.rb', line 69
def ref_for_display
return unless ref.present?
ref.gsub(%r{^refs/(heads|tags)/}, '')
end
|
#set_next_run_at ⇒ Object