Class: Plan
Constant Summary
collapse
- DEFAULT =
'default'
ApplicationRecord::MAX_PLUCK
Class Method Summary
collapse
Instance Method Summary
collapse
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
Class Method Details
.all_plans ⇒ Object
21
22
23
|
# File 'app/models/plan.rb', line 21
def self.all_plans
ALL_PLANS
end
|
.default ⇒ Object
This always returns an object
13
14
15
16
17
18
19
|
# File 'app/models/plan.rb', line 13
def self.default
Gitlab::SafeRequestStore.fetch(:plan_default) do
find_by(name: DEFAULT) || safe_find_or_create_by(name: DEFAULT) { |plan| plan.title = DEFAULT.titleize }
end
end
|
.default_plans ⇒ Object
25
26
27
|
# File 'app/models/plan.rb', line 25
def self.default_plans
DEFAULT_PLANS
end
|
Instance Method Details
#actual_limits ⇒ Object
29
30
31
|
# File 'app/models/plan.rb', line 29
def actual_limits
self.limits || self.build_limits
end
|
#default? ⇒ Boolean
33
34
35
|
# File 'app/models/plan.rb', line 33
def default?
self.class.default_plans.include?(name)
end
|
#paid? ⇒ Boolean
37
38
39
|
# File 'app/models/plan.rb', line 37
def paid?
false
end
|