[DBIx-Class-Devel] [dbix-class] Postpone 'create_related' rows until main row is created (#78)

Eugen Konkov notifications at github.com
Fri May 15 11:20:13 GMT 2015


>I am especially wary of the removal of 'filter'
it is not removed. It were merged as noted here (see -247): ## 'filter' should disappear and get merged in with 'single' above!

Actually, in code, I have changed, there are few point we must pay attention:
1. Create related/child row only after parent (see +255, +272-280)
2. Filter obj is placed into $inflated hash (-258). In new code that done here: +274, +278
3. create_related_rows for 'multi', 'filter', 'single' is same. Except:
 a) 'multi' can not be 'in_storage' otherwise exception: +197
 b) +200-206 are same for 'single' and 'filter' except 'set_from_related' are executed only for 'single'
 c) Now create_related_rows return one object or array of objects. I repeat that behaviour, BUT for future clean code you must not destinguish one or many in both cases must be arrayref

MY RESOLUTION: code is safe and you must not worry about it ;-) **Merge or not it is your decision.** Look at test - all passed.

>test for almost every behavioral change.
This is not behavioral change. It is leaved same. It is better to say this patch is BUGFIX for not noted yet bug: **You can not add slave rows without master row not exist!!!** But code, I have fixed, violate this DB integrity rule.

And actually this patch does not resolve my issue, but this one step to fixit. As I noted here:
https://rt.cpan.org/Public/Bug/Display.html?id=104375#txn-1495569 I loose clue. When I try to get access to parent/master row from children the code at ResutlSource:sub _resolve_condition:1773
return wrong condition UNRESOLVABLE_CONDITION, maybe because it do not know that row in memory yet. And I do not understand the terrible code there.

>Please, if time permits adapt the test from
Yes, I will do that. But in other pull request. As I mentioned this patch does not resolve my issue.
Thank you for your examples and links. They help me. ;-)

PS. I had desire to report about some method renaming and removing, about removing of some part of documentation and add doc for well formed methods (that were renamed). But I guess you will reject that as mine other proposal. So I threw out this idea. It's a pity.

---
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/dbix-class/pull/78#issuecomment-102372876
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20150515/df895d7b/attachment.htm>


More information about the DBIx-Class-Devel mailing list