Archive for October, 2007

Rails : Accessing session data in models

MVC architecture is good for keeping your design neat but once in a while you hit a road block and this is one such situtation.  If you want to log actions/events in your code and track changes to models, you would want to do that in the activerecord callback hooks like after_save and before_destroy. However […]

Popularity: 17% [?]

What is object oriented programming

A talk on object oriented programming by Dan Ingallis, one of the people involved with smalltalk, one of the first OO language

addthis_url = ‘http%3A%2F%2Fwww.prateekdayal.net%2Fblog%2F2007%2F10%2F23%2Fwhat-is-object-oriented-programming%2F’;
addthis_title = ‘What+is+object+oriented+programming’;
addthis_pub = ‘prateek’;

Popularity: 5% [?]

Popularity: 5% [?]

ruby’s respond_to? for checking if a method exists

Ruby has a function called respond_to? that can be used to seeing if a particular class or object has a method with a certain name. The syntax is something like

User.respond_to?(’name’) # returns true is method name exists otherwise false

This came in very handy the other day when I wanted to send emails in muziboo […]

Popularity: 41% [?]

Rubyworks on Debian Etch

I recently got a new VPS account and it runs 64 bit Debain Etch (4.0). I installed rubyworks on it and the installation went pretty smooth. After that, I tried to move muziboo.com files to this server and a lot of error started happening in trying to get the app up.
First one was

muziboo@debian:~/muziboo/muz$ rake db:migrate
(in […]

Popularity: 24% [?]