From: David Vallner Date: 2006-10-07T19:21:20+09:00 Subject: Re: RoR : Shortening this code --------------enigA6B85573E7103654F9F86552 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Zouplaz wrote: > Hello, >=20 > Under Ruby On Rails, I would like to replace >=20 > mouvement =3D Mouvement.find(params[:id]) > mouvement.statut =3D :traite > mouvement.save! >=20 I like this variant better. The whole point of ActiveRecord is that you handle the database tables like objects, and the use of #update_attribute makes the code read more like SQL generator calls instead of ORM use. YMMV. David Vallner --------------enigA6B85573E7103654F9F86552 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFJ3+by6MhrS8astoRAp4RAJ47/vdD70FYlrnCcMGbzs0hWcXjhgCeLaB8 6SA3LDmizL8bllFtrQcIK7U= =afhv -----END PGP SIGNATURE----- --------------enigA6B85573E7103654F9F86552--