4 days of mayhem. Sleepless nights and total work. Now I understand what a 'working professional' feels like. Most of the problems where HTML based. We, me and Amit, did all we could, from fixing HTML to Functional and Unit testing. Even after having worked so hard, we got errors during the demo. These errors were quickly sorted out, but pressurized us. But all that is well, ends well (I am a pessimist by the way).
Ruby On Rails coding has been great up until now. Yesterday I had a party along with Vivek, Rohan, Abhilash, Abhijat and Amit, and then Vivek told me the problem he faced when a query fired via find_by_sql took 5 secs to execute. He tells that the query is a simple one with a where clause, no 'in' statements, but fetches 20000 odd records. The same query run via php-myadmin runs in .00x odd secs. Is the Active Record a bad ORM then? I also find many people stating that not using the Active Record in Rails will solve a whole lot of problems.
It was also interesting to find that the ':include' option in 'find' will return you the object to which it has Foreign Key - Primary Key relationship. But it doesnot work if there is a select clause. But why ? If i have a credit table and a user table, then I cant write a find statement, with :include, which gives me the credit amount and the user data? It is a join at the end of the day and the populated stuff, which I understand is bad, could be populated along with the user hash too. This is also the case if I iterate through an array with records which were fetched with along with a select statement. Could not decide if this were logical.
We also put some validations along with the code. Live Validation was introduced to me for the first time and I loved it. I also understand there is a RoR plug-in for this which directly hooks up to the model and then writes its own Javascript code according to the validations given at the model level. Thats just 'WOW' !
I out of ideas as it has been a long time now that I have written something.
But as Arnie says 'I'll Be Back !'
No comments:
Post a Comment