def setup_associates(klass, relation, meta, parent_relation)
      assoc_name =
        if relation.associations.key?(parent_relation)
          parent_relation
        else
          singular_name = Inflector.singularize(parent_relation).to_sym
          singular_name if relation.associations.key?(singular_name)
        end

      if assoc_name
        klass.associates(assoc_name)
      else
        klass.associates(parent_relation)
      end
    end
def setup_associates(klass, relation, meta, parent_relation)
      assoc_name =
        if relation.associations.key?(parent_relation)
          parent_relation
        else
          singular_name = Inflector.singularize(parent_relation).to_sym
          singular_name if relation.associations.key?(singular_name)
        end

      if assoc_name
        klass.associates(assoc_name)
      else
        klass.associates(parent_relation)
      end
    end
Sets up `associates` plugin for a given command class and relation

 @param [Class] klass The command class
 @param [Relation] relation The relation for the command

 @api private