How do I convert boolean values to integers?
inflection_point = (firm.inflection_point ? 1 : 0)
Another alternative is use of short-circuit operators:
inflection_point && 1 || 0
irb(main):001:0> true && 1 || 0
=> 1
irb(main):002:0> false && 1 || 0
=> 0