- C
- F
- O
- R
- S
- T
- V
Instance Public methods
checkbox?() Link
Source: show
# File app/models/db/custom_field.rb, line 53 def checkbox? %w[checkbox m-checkbox].include?(field_type) end
for_specific_plan?(plan_id) Link
Source: show
# File app/models/db/custom_field.rb, line 83 def for_specific_plan?(plan_id) plans.pluck(:id).include?(plan_id) end
format_value(value) Link
Source: show
# File app/models/db/custom_field.rb, line 37 def format_value(value) if Flipper.enabled?(:boolean_custom_fields) if select? && multiple? && value.is_a?(String) value.split(",") else value end elsif checkbox? value == "yes" elsif select? && multiple? && value.is_a?(String) value.split(",") else value end end
options=(value) Link
Source: show
# File app/models/db/custom_field.rb, line 33 def options=(value) super(ActionController::Base.helpers.strip_tags(value)) end
radio?() Link
Source: show
# File app/models/db/custom_field.rb, line 65 def radio? field_type == "radio" end
select?() Link
Source: show
# File app/models/db/custom_field.rb, line 61 def select? field_type == "select" end
textarea?() Link
Source: show
# File app/models/db/custom_field.rb, line 57 def textarea? field_type == "textarea" end
valid_for_plan?(plan_id) Link
Source: show
# File app/models/db/custom_field.rb, line 79 def valid_for_plan?(plan_id) allow_all_plans || for_specific_plan?(plan_id) end
valid_instance_value?(field_value) Link
Source: show
# File app/models/db/custom_field.rb, line 69 def valid_instance_value?(field_value) if Flipper.enabled?(:boolean_custom_fields) field_value&.present? elsif %w[checkbox m-checkbox].include?(field_type) field_value == "yes" else field_value.try(:present?) end end