remove 'true?' helper from custom_value

pull/2550/head
Jan Sandbrink 10 years ago
parent 937fa2fba7
commit 1a25e19c2f
  1. 4
      app/helpers/custom_fields_helper.rb
  2. 5
      app/models/custom_value.rb

@ -55,7 +55,9 @@ module CustomFieldsHelper
when 'text'
text_area_tag(field_name, custom_value.value, id: field_id, rows: 3, style: 'width:90%')
when 'bool'
hidden_field_tag(field_name, '0') + check_box_tag(field_name, '1', custom_value.true?, id: field_id)
hidden_tag = hidden_field_tag(field_name, '0')
checkbox_tag = check_box_tag(field_name, '1', custom_value.typed_value, id: field_id)
hidden_tag + checkbox_tag
when 'list'
blank_option = if custom_field.is_required? && custom_field.default_value.blank?
"<option value=\"\">--- #{l(:actionview_instancetag_blank_option)} ---</option>"

@ -62,11 +62,6 @@ class CustomValue < ActiveRecord::Base
strategy.typed_value
end
# Returns true if the boolean custom value is true
def true?
self.value == '1'
end
def editable?
custom_field.editable?
end

Loading…
Cancel
Save