Class: ProjectSetting
Constant Summary
collapse
- ALLOWED_TARGET_PLATFORMS =
%w(ios osx tvos watchos android).freeze
ApplicationRecord::MAX_PLUCK
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
Instance Method Details
#human_squash_option ⇒ Object
39
40
41
42
43
44
45
46
|
# File 'app/models/project_setting.rb', line 39
def human_squash_option
case squash_option
when 'never' then 'Do not allow'
when 'always' then 'Require'
when 'default_on' then 'Encourage'
when 'default_off' then 'Allow'
end
end
|
#squash_enabled_by_default? ⇒ Boolean
27
28
29
|
# File 'app/models/project_setting.rb', line 27
def squash_enabled_by_default?
%w[always default_on].include?(squash_option)
end
|
#squash_readonly? ⇒ Boolean
31
32
33
|
# File 'app/models/project_setting.rb', line 31
def squash_readonly?
%w[always never].include?(squash_option)
end
|
35
36
37
|
# File 'app/models/project_setting.rb', line 35
def target_platforms=(val)
super(val&.map(&:to_s)&.sort)
end
|