Skip to content

Improve Service model

The following discussion from !39959 (merged) should be addressed:

  • @vij started a discussion:

    Non-blocking question: I've not seen private_class_method before, seems handy! I wonder if it would be better passing it the method name as symbol manually, to improve readability, WDYT?

    e.g.

      def self.build_nonexistent_services_for(existing_services)
        ...
      end
      private_class_method :build_nonexistent_services_for

    I can see you've made it consistent with other uses of it this class hence this being a non-blocking question, but I'm just not sure which is better, and it looks like we have a mis-match of consistency across the codebase 🤔

  • Service model is mixing instance and class methods, we should improve the method definition order of the class. Reference: Use a consistent structure in your class definitions.

  • Clarify use of map vs pluck. !39959 (comment 399535095) it's more performance map 😉, see a93b591b (comment 333641654) and !27396 (comment 307122761).

  • Rename service model scopes !39959 (comment 401053196)

Edited by Arturo Herrero