[Koha-bugs] [Bug 18182] TestBuilder should be able to return Koha::Object objects

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Mar 6 15:10:05 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18182

--- Comment #4 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Marcel de Rooy from comment #3)
> Great, Tomas.
> 
> Few remarks:
> I would rather remove the id column. We c/should take care of that in the
> code.
> Like:
> my @pk = $schema->source('Borrower')->primary_columns;
> Note that we theoretically can have multiple columns. (We don't have such
> Koha objects, but iirc we have one or two tables like that.)

I agree. Read the next answer to have context.

> Similarly, it would be more consistent and less confusing to use the
> singular form. We do so in build; I would expect the same for build_object.
> Additionally, you return just one singular object.

Singular classes are not aware of the plural class name. And we need the plural
to ->find the created object. That's the design decision I don't like about
koha::object(s). I'm open to opinions, but the only solutions are
-annotate singular classes so they know their plural
-move the plural methods to the singular classes and get rid of plural

I vote for the latter, of course. But that would be a bigger dev.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list