Site Archives Technology

Git - Fast Version Control System


Git is getting popular in Rails community these days, as there were being many changes in rails to support Git.
Git is a open sourse fast version controller system. It was originally designed by Linus Torvalds to handle large projects. It was inspired by Monotone & BitKeeper. It is a distributed version controlling system. It gives […]

Migration: Adding/Removing columns are now much easier


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 […]

Ruby Script for SVN commit notification with log message, list of updated files and readable colored SVN Diff


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 […]

Single Table Inheritance validates_uniqueness_of Problem


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 […]

Running Rails Application on https with pound


Hours ago, I posted about, “How to deploy rails application with pound as a Balancer”.
Lets run rails application on https with pound. For that your machine should have:
* Pound installed with ssl support
* Pound and mongrels running
Now, First of all we need a ssl certificate, that can be generate by issuing “openssl req -x509 -newkey […]