Description
Martin Renvoize (ashimema)
2025-03-31 09:22:49 UTC
Created attachment 179985 [details] [review] Bug 39488: Add $result to Koha::Objects `object_class` calls This allows us to do dynamic polymorphic classing on calls to 'find', 'find_or_create', 'single', 'next', 'last' and 'as_list' etc. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 179986 [details] [review] Bug 39488: Add template for required polymorphic class methods Created attachment 179987 [details] [review] Bug 39488: Use introspection in TestBuilder tests We update the testbuilder tests here to look for signs of a polymorphic class map and use it to test the different class options for this base class Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Hmm, I'm struggling to come up with explicit tests for these changes. The main change here is that we consistently pass the original DBIx::Class row objects into the object_class meta method so that we can query the content to ascertain which polymorphpihc subclass to use for the subsequent _new_from_dbic calls. Created attachment 180189 [details] [review] Bug 39488: Unit tests Transferring Kyles SO from the bug this was split out from. Created attachment 185006 [details] [review] Bug 39488: Add $result to Koha::Objects `object_class` calls This allows us to do dynamic polymorphic classing on calls to 'find', 'find_or_create', 'single', 'next', 'last' and 'as_list' etc. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 185007 [details] [review] Bug 39488: Add template for required polymorphic class methods Created attachment 185008 [details] [review] Bug 39488: Use introspection in TestBuilder tests We update the testbuilder tests here to look for signs of a polymorphic class map and use it to test the different class options for this base class Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 185009 [details] [review] Bug 39488: Unit tests Created attachment 185931 [details] [review] Bug 39488: Add $result to Koha::Objects `object_class` calls This allows us to do dynamic polymorphic classing on calls to 'find', 'find_or_create', 'single', 'next', 'last' and 'as_list' etc. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 185932 [details] [review] Bug 39488: Add template for required polymorphic class methods Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 185933 [details] [review] Bug 39488: Use introspection in TestBuilder tests We update the testbuilder tests here to look for signs of a polymorphic class map and use it to test the different class options for this base class Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Created attachment 185934 [details] [review] Bug 39488: Unit tests Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> |