app/models/custom_field_date_pair.rb
# For rendering paired values
# Handle case where both pairs are blank
#------------------------------------------------------------------------------
For rendering paired values
Handle case where both pairs are blank
For rendering paired values Handle case where both pairs are blank
def render_value(object)
    return "" unless paired_with.present?
    from = render(object.send(name))
    to = render(object.send(paired_with.name))
    if from.present? && to.present?
      I18n.t('pair.from_to', from: from, to: to)
    elsif from.present? && !to.present?
      I18n.t('pair.from_only', from: from)
    elsif !from.present? && to.present?
      I18n.t('pair.to_only', to: to)
    else
      ""
    end
  end
def render_value ( object ) return "" unless paired_with . present? from = render ( object . send ( name ) ) to = render ( object . send ( paired_with . name ) ) if from . present? && to . present? I18n . t ( 'pair.from_to' , from : from , to : to ) elsif from . present? && ! to . present? I18n . t ( 'pair.from_only' , from : from ) elsif ! from . present? && to . present? I18n . t ( 'pair.to_only' , to : to ) else "" end end
For rendering paired values
Handle case where both pairs are blank
For rendering paired values Handle case where both pairs are blank
object