Bug 21073: (QA follow-up) Simplify logic
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 17 Jun 2019 11:07:03 +0000 (08:07 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 18 Jun 2019 16:30:31 +0000 (17:30 +0100)
commit493292b36c1513a90415d144ec72c10e36ff7968
tree958d43ad8ffc69699b08e2ba9b8bed0fbe9e0c87
parent22aa6ecd478c1c5a08eecb2780f5c0b1b7589b99
Bug 21073: (QA follow-up) Simplify logic

This patch simplifies the logic inside GetPlugins so:
- It uses Koha::Plugins::Methods instead of plain SQL
- It doesn't do more DB calls than needed, by filtering on method in the
  initial query to Koha::Plugins::Methods.

It also relies on the (newly introduced) ->is_enabled method in
Koha::Plugins::Base, for better readability.

To test:
- Run the tests and notice no behaviour changes are introduced.

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Koha/Plugins.pm