Archive for the 'ruby' Category

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

I was using acts_as_searchable for one of my project, which uses Hyperestraier in background. Yesterday I decided to use acts_as_solr which uses solr(based on Lucene Java search library). I did all written in its Manual/Readme, but when I issued

rake solr:start

to start the solr server, it threw a heart breaking “Bad file descriptor” error, [...]

Thursday, September 13th, 2007 | 3 Comments

Wednesday, September 5th, 2007 | No Comments

I participated in August Rails Hackfest which was a great experience.
You can see the missing August 2007 from the Post Archives. I didn’t post anything last month as I was busy in submitting rails patches. I submitted a lot of patches out of which I got one patch committed to the rails code under changeset [...]

Sunday, September 2nd, 2007 | No Comments

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