Found a validation bug

Subscribe to Found a validation bug 2 post(s), 2 voice(s)

 
Avatar Rob 4 post(s)

Thanks for the book and the sample code. Good, functional stuff.

I found a latent bug I thought I’d share, and mention another Rails 2.0 route change.

When entering a exercise in a workout, I forgot to select an existing activity or type in a name of a new one. This created a activity with a null exercise_id, which horked up the workout big time. In activity.rb model, add the following line -

validates_presence_of :exercise_id, :workout_id

The route change was for the goal, adding :name_prefix -

goal.resources :results, :name_prefix => nil

as you mentioned in this post

Thanks.

 
Avatar EldonAlameda Administrator 196 post(s)

Cool Rob – thanks for sharing. I’ve haven’t had a chance to pull up the source yet and verify but what you’re saying sounds like something that was missed. Once i verify – i’ll add it to the errata here.