Archive for the 'web development' Category

You may have noticed by now, that in Rails 2.0 changeset 7422, you can specify columns you want to add/remove in your migration by passing attribute:type pairs to the migration generator.
For example, lets assume that we need to add a column ‘role’ in users table(User model). In this case generate a migration like:

script/generate migration [...]

Wednesday, January 23rd, 2008 | No Comments

Some days ago I wrote a post about “SVN commit notification” which uses a perl script for sending commit notification with svn diff by mail. In this mail you can find svn diff from the last committed revision. I used to love this mail, soon I realized that it is a bit ugly and difficult [...]

Monday, January 14th, 2008 | 1 Comment

Consider a case of STI where:

class User < ActiveRecord::Base
validates_uniqueness_of :name
end

class Customer < User

end

class Manager < User

end

Now try following at console:

User.create(:name => “Akhil Bansal”)
Manager.create(:name => “Akhil Bansal”)
Customer.create(:name => “Akhil Bansal”)

This will let you create three records in users table with same name, validates_uniqueness_of written in User class has no effect on it. validates_uniqueness_of automatically [...]

Friday, October 26th, 2007 | No Comments

Now a days Apache + mod_proxy + mongrel_clusters, Lighttpd + Mongrel cluster and Nginx + mongrel cluster are well known for deploying rails applications.
You can also deploy your rails application with pound(a reverse proxy, load balancer and HTTPS front-end for Web server).
First you need to setup mongrel_clusters for your rails application by issuing [...]

Thursday, September 13th, 2007 | 1 Comment

Yesterday I posted about CruiseControl for Rails projects. It was working fine with all my rails projects using traditional test cases, But today I faced a problem with a project using RSpec. Actually, By default CruiseControl follows the following step to build:

rake db:test:purge
rake db:migrate
rake test

This default was not working with my last project As I [...]

Thursday, August 30th, 2007 | No Comments