When coding is not fun

You know what sucks.

Staying up until 1 in the morning trying to figure why some code you wrote will not work, when every piece of documentation you read seem to suggest that it should work.

Then you find out its because the codebase you are working with has some custom extensions that overwrite the basic functionality you relied on.


It goes like so…. I was trying to do this:

@person.attributes = params[:person]

This is very simple and straightforward. Set the attributes to the submitted params. Just a basic Hash merging.

Well, my logs kept reporting sql queries for things like SELECT, UPDATE, SHOW, etc… I guess it wouldn’t have mattered, but the damn UPDATE query was messing up my data object.

After almost an entire day of fumbling around the internet, countless forums, and even hitting up the IRC, I followed Bennie tip and found that it was because there was a custom extension that extended the basic “attributes=” of activerecord.

Sigh……………… Why……… Why…… Why……..

Categorized as Rant