Sha256: d6a4267f7d01b528203365f846602f55abce45045e1348d82eafa7cfde5d00eb

Contents?: true

Size: 501 Bytes

Versions: 3

Compression:

Stored size: 501 Bytes

Contents

module Dune::Api
  module V1
    class UsersController < BaseController
      include PaginatedController

      before_action :require_admin!, only: :index
      has_scope :pg_search, as: :query

      def index
        respond_with_pagination collection
      end

      def show
        respond_with User.find(params[:id])
      end

      private

      def collection
        @collection ||= begin
          apply_scopes(User).order('created_at desc').all
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dune-api-1.1.0 app/controllers/dune/api/v1/users_controller.rb
dune-api-1.0.2 app/controllers/dune/api/v1/users_controller.rb
dune-api-1.0.1 app/controllers/dune/api/v1/users_controller.rb