Gender.create([
{:name => "Male", :is_default => true},
{:name => "Female", :is_default => true}
]) if Gender.all.blank?
Refactorings
No refactoring yet !
Nathan
March 19, 2010, March 19, 2010 13:20, permalink
Refactoring isn't really meant to be about speed. If you're concerned about speed, Ruby on Rails probably isn't the best choice of technology to use. Refactoring is about simplicity, readability, scalability, etc. These attributes often come at the expense of execution speed, but the belief is that lower development time and cost make up for the additional cost of better hardware.
Can't we create first all records and then update is_default for all records?
Which is the faster process?