Browse Source

refactor: ensure label_from_value always accepts log & nil as args

fix-remove-attr-accessors-from-questions-in-cldc-1723
Sam Seed 2 years ago
parent
commit
1c5eb09290
  1. 2
      app/models/form/common/questions/created_by_id.rb
  2. 2
      app/models/form/common/questions/owning_organisation_id.rb
  3. 2
      app/models/form/lettings/questions/created_by_id.rb
  4. 2
      app/models/form/question.rb

2
app/models/form/common/questions/created_by_id.rb

@ -24,7 +24,7 @@ class Form::Common::Questions::CreatedById < ::Form::Question
answer_options.select { |k, _v| user_ids.include?(k) } answer_options.select { |k, _v| user_ids.include?(k) }
end end
def label_from_value(value) def label_from_value(value, log = nil, user = nil)
return unless value return unless value
answer_options[value] answer_options[value]

2
app/models/form/common/questions/owning_organisation_id.rb

@ -21,7 +21,7 @@ class Form::Common::Questions::OwningOrganisationId < ::Form::Question
answer_options answer_options
end end
def label_from_value(value) def label_from_value(value, log = nil, user = nil)
return unless value return unless value
answer_options[value] answer_options[value]

2
app/models/form/lettings/questions/created_by_id.rb

@ -27,7 +27,7 @@ class Form::Lettings::Questions::CreatedById < ::Form::Question
answer_options.select { |k, _v| user_ids.include?(k) } answer_options.select { |k, _v| user_ids.include?(k) }
end end
def label_from_value(value) def label_from_value(value, log = nil, user = nil)
return unless value return unless value
answer_options[value] answer_options[value]

2
app/models/form/question.rb

@ -151,7 +151,7 @@ class Form::Question
end end
end end
def label_from_value(value, user = nil) def label_from_value(value, log = nil, user = nil)
return unless value return unless value
label = case type label = case type

Loading…
Cancel
Save