[Dbix-class] Difference between has_many and might_have

Priya Sivaraman priyasi at TechMahindra.com
Mon Apr 16 08:18:01 GMT 2007


I have defined a list of tables that has some relation to each other. At
the beginning I was using has_many to define some relation between
table1 and table2. The relation between table1 and table2 might be for
each record in table1 there can be 0 or more records in table2. For that
I use to have the has_many relationship.

 

Now when I am trying to use the copy command to make a copy of record in
table1 I am having problem. It throws error telling "Cannot insert the
record in table2 due to violation of UNIQUE constraint";

 

Now I tried using might_have it is not throwing error.

 

I would like to know the impact of changing this has_many to might_have.
Because I used dev server and did the testing. Now when I will move the
code to live I would like to know whether this code will have any
impact.

 

 



============================================================================================================================
 
Disclaimer:

This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.

============================================================================================================================
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070416/f558f0eb/attachment-0001.htm


More information about the Dbix-class mailing list