app/models/applications/application_for_offering.rb
def type_cast_dynamic_answer(answer)
    if answer.nil?
      nil
    elsif answer == "true"
      true
    elsif answer == "false"
      false
    elsif answer.match /^\d+$/
      answer.to_i
    elsif answer.match /^\d+.\d+$/
      answer.to_f
    else
      answer
    end
  end
# Tries to type cast the dynamic answer that's returned from the DB, which is stored as a string.
# 
# * "true" or "false" gets cast to +true+ and +false+
# * numbers with no decimal points get converted to int
# * numbers with decimal points get converted to float
Tries to type cast the dynamic answer that's returned from the DB, which is stored as a string.
"true" or "false" gets cast to +true+ and +false+
numbers with no decimal points get converted to int
numbers with decimal points get converted to float
Tries to type cast the dynamic answer that ' s returned from the DB which is stored as a string . " true " or " false " gets cast to + true + and + false + numbers with no decimal points get converted to int numbers with decimal points get converted to float
def type_cast_dynamic_answer(answer)
    if answer.nil?
      nil
    elsif answer == "true"
      true
    elsif answer == "false"
      false
    elsif answer.match /^\d+$/
      answer.to_i
    elsif answer.match /^\d+.\d+$/
      answer.to_f
    else
      answer
    end
  end
def type_cast_dynamic_answer ( answer ) if answer . nil? nil elsif answer == "true" true elsif answer == "false" false elsif answer . match / ^ \d +$ / answer . to_i elsif answer . match / ^ \d +. \d +$ / answer . to_f else answer end end
Tries to type cast the dynamic answer that's returned from the DB, which is stored as a string.
Tries to type cast the dynamic answer that ' s returned from the DB which is stored as a string .
answer