07 Mar 2007
This has got to be my favorite RoR error message:
1) Error: test_truth(Admin::EscalationMgt::EscalationViewsControllerTest): ArgumentError: Admin::EscalationMgt is not missing constant EscalationViewsController!
Only in Rails would the fact that you are trying to use a constant that does exist be an error.
10 Jan 2007
•
Miscellaneous
•
Software Development
I have been at my new job for just over a month now so I suppose it is time to post something about it. I joined Absolute Performance at the end of November. We do “operations management solutions” which is marketing speak for helping you – both reactively and proactively – keep your applications, and systems, available and meeting SLAs.
I am back to developing in Ruby which makes me immensely happy. The technology around here is a mix of C++ and Ruby but my primary role is working on the browser based front-end for our monitoring infrastructure. That means I spend the vast majority of my time in Rails. It has been a great pleasure moving back into Ruby after being exiled into PHP, on which really cannot be overstated.
With the new job I expect my posting frequency to pick up a little. At my previous company there turned out to be some concerns about my some of my posts. That really took the joy out of posting, and therefore reduced the number precipitously. I look forward to working my way back to something like my peak frequency.
04 Jan 2007
•
Miscellaneous
There are days when I am nearly overwhelmed by the beauty around me. Today is one of those days. The front range is so beautiful today I just had to share it even though my camera phone really does not do it justice.
I took this picture on my commute to work this morning. I have a longish commute, over 30 minutes each way. Most days I wish it were shorter but overall it is not that bad. It is all low stress driving and I have gorgeous views for almost the entire drive.
04 Jan 2007
I happened upon DrySQL the other day and I was immediately interested. DrySQL is an add-on to the standard ActiveRecord support in Rails that uses a lot more of the meta-data in the database to generated the model classes. The standard ActiveRecord classes basically just use the column names to create accessor and modifier methods for the models. DrySQL takes the idea of using the database schema definition as a source of information much further. It figures out the primary key looking for the primary key column in the database, rather than a column named ‘id’. It setups up validations based on the data type of the columns in the database. It defines joins based on the referential constraints. So basically DrySQL is trying to make ActiveRecord what it should have been from the beginning.
I was really happy when I found that someone is working on improving ActiveRecord. I have always been annoyed by in the inconsistencies of Rails ActiveRecord. For example, Rails ActiveRecord requires some of the meta-data to reside in the DB and some to reside in the code has bugged me. Even worse your are actually required to duplicate some of the meta-data by the standard ActiveRecord library, for example validations.
I use the past tense for my happiness because today I installed DrySQL and I am no longer all that happy. It may well do exactly what it says, which I will just assume, but unfortunately I don’t have time to really test it. The reason I do not have time to test it is that it adds a least twenty four (24) seconds to the response time for every single request. One of the simplest requests the application handles goes from
Completed in 0.18736
to
Completed in 24.24459
simply by adding require_gem 'drysql'
to environment.rb.
That twenty four seconds seems to be to build the User model. Requests that instantiate other models incur even greater overhead. This kind of performance hit is completely untenable. While this overhead would be less of an issue in production because this generation will only be done once per model class it is still a complete show stopper for me, and I suspect for most other people. Really, who can give up thirty seconds of their life every single request, even in their development environment?
There is a possibility, and I really hope this is the case, that this is performance issue really just artifact of my environment. I am running a fairly recent version of Edge Rails (a couple of weeks old), postgres 0.7.1 (installed as gem) and postgresql-8.1 all on Edgy. I would love to hear about it if you see a problem with my setup (or if you are using DrySQL without these issues).
Even though this version of DrySQL does not seem to work for today I remain hopeful. DrySQL is definitely the way ActiveRecord should work and there is no reason generating the model class should take an excessive amount of time. Perhaps the next version of DrySQL will be more performant.
08 Nov 2006
•
Miscellaneous
•
Software Development
Colorado Startups has created an events calendar.
As you might have guessed, there are lots of interesting events happening in the Denver-Boulder area but finding out about them is sometimes a little difficult. Having someone find and aggregate that information into a single calendar is immensely helpful.
They are using Google Calendar as the host of the information which means that you can subscript to the calender with RSS or include it in any other calenders you might already have. I really like that second option as started keeping track of my schedule in Google Calendar already.