From fa1e6eed00d6f636682027799640f66470ec34ba Mon Sep 17 00:00:00 2001 From: MAEDA Go Date: Sun, 30 May 2021 14:03:54 +0900 Subject: [PATCH 1/2] Use a variable to reference a CustomField object --- app/helpers/custom_fields_helper.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/helpers/custom_fields_helper.rb b/app/helpers/custom_fields_helper.rb index 256d6b635..46762e91f 100644 --- a/app/helpers/custom_fields_helper.rb +++ b/app/helpers/custom_fields_helper.rb @@ -79,18 +79,19 @@ module CustomFieldsHelper # Return custom field html tag corresponding to its format def custom_field_tag(prefix, custom_value) - css = custom_value.custom_field.css_classes + cf = custom_value.custom_field + css = cf.css_classes data = nil - if custom_value.custom_field.full_text_formatting? + if cf.full_text_formatting? css += ' wiki-edit' data = { :auto_complete => true } end - custom_value.custom_field.format.edit_tag( + cf.format.edit_tag( self, - custom_field_tag_id(prefix, custom_value.custom_field), - custom_field_tag_name(prefix, custom_value.custom_field), + custom_field_tag_id(prefix, cf), + custom_field_tag_name(prefix, cf), custom_value, :class => css, :data => data) -- 2.31.1