From: zdennis Date: 2006-08-29T11:34:55+09:00 Subject: Re: ActiveRecord, has_many and _count ... -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 zdennis wrote: > > This is one way of doing it. Although if you have the id of the Country > you can just say: > company = Company.create( :company_name=>'ABC Co', :country_id=>1 ) > OR > company = Company.new( :company_name=>'ABC Co', :country_id=>1 ) > company.save > > Both of these will update the country countries_counter because you have ^^^^^^^^^^^^^^^ should be companies_counter. ;) Zach -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFE86hbMyx0fW1d8G0RAsWHAJ0XsQqlFXZePu0A+xXdsw3FRn4DfQCfUAyX xNpxNiX3RqhDAfutQC3Ud1k= =P1Yo -----END PGP SIGNATURE-----