I'm not having success in this before_save callback in Rails.
before_save :set_shot_time
after_save :set_status
def set_shot_time
case :id
when 1..24
puts self.shot_time = "9:00 a.m."
when 25..49
puts self.shot_time = "9:15 a.m."
when 50..74
puts self.shot_time = "9:30 a.m."
when 75..99
puts self.shot_time = "9:45 a.m."
when 100..124
...
end
This does not generate the desired attribute in the shot_time row of my pg database. Is it my syntax? I don't get any errors, and the log shows nothing either.