Random thoughts from a middle aged guy starting a new career

Just when I thought I was out ...

28 Aug 2013

... they pull me back in.

This web development thing has been going alright. Sometimes I feel really stupid, sometimes I feel less stupid, but I'm learning new things all the time and I like it. The last thing I was thinking about was broadcasting, let alone the Red Sox on NESN. Turns out I'll be in the booth Friday night. I've enjoyed watching and listening to the games since I left Fenway in April, but it's been different. It certainly hasn't been a job. I'm happy to help out when I can and I'm really looking forward to it, but I almost said no.

First of all I've got this new job at Barbershop Labs and it's really important to me. Then there's the fact that I'm really a play by play guy, not an analyst. On top of all that I had pretty much turned the page on the broadcasting thing. Then they said, "You know you'll get to work with Don Orsillo." That's when I knew I couldn't refuse.

I'm watching the Sox and Orioles right now. I'm trying to finish up this quick blog post. Then it's right back to code. After I pick up my daughter from cheerleading practice of course.

--- Warning: the last bit may not make much sense to the less technically inclined. ---

As for my project, well last night was one of those nights I felt really stupid. I'm using devise for authentication. You install and it pretty much handles everything about registering a user out of the box. It just works. Who needs a test for that? Turns out me! I installed devise pretty early on. Did a bunch of other stuff. Couldn't get a nested form to work and was getting really frustrated. Then I started taking things apart and backing up. Turns out the one thing I took for granted - simply signing up a user through devise - no longer worked. But how? That's not supposed to happen. Well that's true, unless you (meaning me the junior developer) do something foolish to break it.

I set a boolean admin attribute on my user model. The only attribute I added to the default attributes generated by devise. Then for some unknown reason I set a presence_of validation on the admin attribute. Of course I don't need one because I set a default value of false. There is no admin field in the user registration form, so when you hit submit the validation fails in the model. It took me a long time to figure that out. Two mistakes - a needless validation and a test that should have been written in the first place.

I hoping writing about these mistakes proves to be therapeutic. I also hope it helps me never make them again.