From: Jim Freeze Date: 2004-06-10T13:42:35+09:00 Subject: Re: [ANN] Active Record 0.8.3: Modules, mapping, and transactions On Thursday, 10 June 2004 at 12:46:09 +0900, John W. Long wrote: > David Heinemeier Hansson wrote: > >* Create new Active Record objects by setting the attributes through a > >block. Like this: > > > > person = Person.new do |p| > > p.name = 'Freddy' > > p.age = 19 > > end > > Why is the better than: > > person = Person.new( > 'name' => 'David', > 'age' => 12 > ) > Maybe because you have more freedom to do complex operations like this: > > person = Person.new do |p| > > p.name = 'Freddy' ... code here to compute age > > p.age = age > > end > -- Jim Freeze ... A solemn, unsmiling, sanctimonious old iceberg who looked like he was waiting for a vacancy in the Trinity. -- Mark Twain