79099987

Date: 2024-10-17 22:18:49
Score: 0.5
Natty:
Report link

The solution was remarkably easy. Adding .to_i on the set_duration call solved it - apparently passing an int to postgres instead of a float makes all the difference!

  def set_duration
    self.duration = (end_datetime - start_datetime).to_i
  end

It's still not totally clear to me why Rails 7.2 broke the previous functionality, but a quick solution like this is a win.

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: NGobin