ForestAdmin/forest-rails

View on GitHub
app/services/forest_liana/utils/beta_schema_utils.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
module ForestLiana
  module Utils
    class BetaSchemaUtils
      def self.find_action_from_endpoint(collection_name, endpoint, http_method)
        collection = ForestLiana.apimap.find { |collection| collection.name.to_s == collection_name }

        return nil unless collection

        collection.actions.find { |action| (action.endpoint == endpoint || "/#{action.endpoint}" == endpoint) && action.http_method == http_method }
      end
    end
  end
end