[Dbix-class] Difference between belongs_to and has_one

Drew Taylor taylor.andrew.j at gmail.com
Thu Oct 19 15:33:01 CEST 2006


This morning I was doing some work on relationships and ran into this question:
What is the difference between belongs_to and has_one/might_have?

They seem VERY similar. AFAICT the fundamental difference is that with
belongs_to cascading delete is turned off, while with has_one
cascading delete is turned on by default. Is there any other
differences between these two?

Thanks,
Drew
-- 
----------------------------------------------------------------
 Drew Taylor                 *  Web development & consulting
 Email: drew at drewtaylor.com  *  Site implementation & hosting
 Web  : www.drewtaylor.com   *  perl/mod_perl/DBI/mysql/postgres
 ----------------------------------------------------------------



More information about the Dbix-class mailing list