--Apple-Mail-4-657377403
Content-Transfer-Encoding: 7bit
Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed

Hi,

On Jun 27, 2007, at 4:05 PM, shawn bright wrote:

> Hello all,
> i have been using ActiveRecord in a couple of GUI applications  
> recently and
> it is working really well.
> i was wondering though, if it is possible to have a class defined  
> that i can
> change one of the has_many or belongs_to declarations
> dynamically. In a model, i declare one like this.
>
> class Person ActiveRecord::Base
>    has_many :records
>
> now, is the has_many some sort of attribute, class variable, etc...
> i mean if in my program, i wanted to change the
> has_many :records   to something like
> has_many :hats

<code>
has_many :hats, :class_name 'Record', :foreign_key 'hat_id'
</code>

Good luck!

--
Igor Sutton
igor.sutton / gmail.com




--Apple-Mail-4-657377403
content-type: application/pgp-signature; x-mac-type=70674453;
	nameP.sig
content-description: This is a digitally signed message part
content-disposition: inline; filename=PGP.sig
content-transfer-encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFGgsYmKuhQxiIVvZwRAuBMAJ4sBOnm25LaBCogT9icM8J9QIdlyQCgrnhF
c362dSMiLQqwZb8b5IuV+Kw
Ax
-----END PGP SIGNATURE-----

--Apple-Mail-4-657377403--