Sha256: 5379ee8a5ae53dedffcc0230ec7c36ce9ebbc7da423e47e0a7c1d35f60975b1a

Contents?: true

Size: 477 Bytes

Versions: 12

Compression:

Stored size: 477 Bytes

Contents

require_dependency "scimitar/application_controller"

module Scimitar
  class SchemasController < ApplicationController
    def index
      schemas = Scimitar::Engine.schemas

      schemas.each do |schema|
        schema.meta.location = scim_schemas_url(name: schema.id)
      end

      schemas_by_id = schemas.reduce({}) do |hash, schema|
        hash[schema.id] = schema
        hash
      end

      render json: schemas_by_id[params[:name]] || schemas
    end

  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
scimitar-2.7.3 app/controllers/scimitar/schemas_controller.rb
powerhome-scimitar-1.0.0 app/controllers/scimitar/schemas_controller.rb
scimitar-2.7.2 app/controllers/scimitar/schemas_controller.rb
scimitar-1.8.2 app/controllers/scimitar/schemas_controller.rb
scimitar-1.8.1 app/controllers/scimitar/schemas_controller.rb
scimitar-2.7.1 app/controllers/scimitar/schemas_controller.rb
scimitar-1.8.0 app/controllers/scimitar/schemas_controller.rb
scimitar-2.7.0 app/controllers/scimitar/schemas_controller.rb
scimitar-1.7.1 app/controllers/scimitar/schemas_controller.rb
scimitar-2.6.1 app/controllers/scimitar/schemas_controller.rb
scimitar-1.7.0 app/controllers/scimitar/schemas_controller.rb
scimitar-2.6.0 app/controllers/scimitar/schemas_controller.rb