Sha256: bec436638fa1043c444c80176ee47e088529d0d85baea5d124fbb6dbafbc5a56

Contents?: true

Size: 975 Bytes

Versions: 14

Compression:

Stored size: 975 Bytes

Contents

module Api::V1::Users::ControllerBase
  extend ActiveSupport::Concern

  module StrongParameters
    # Only allow a list of trusted parameters through.
    def user_params
      strong_params = params.require(:user).permit(
        *permitted_fields,
        :email,
        :first_name,
        :last_name,
        :time_zone,
        :locale,
        # 🚅 super scaffolding will insert new fields above this line.
        *permitted_arrays,
        # 🚅 super scaffolding will insert new arrays above this line.
      )

      process_params(strong_params)

      strong_params
    end
  end

  included do
    load_and_authorize_resource :user, class: "User", prepend: true,
      member_actions: (defined?(MEMBER_ACTIONS) ? MEMBER_ACTIONS : []),
      collection_actions: (defined?(COLLECTION_ACTIONS) ? COLLECTION_ACTIONS : [])

    private

    include StrongParameters
  end

  # GET /api/v1/users
  def index
  end

  # GET /api/v1/users/:id
  def show
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bullet_train-api-1.1.15 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.14 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.13 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.12 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.11 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.10 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.9 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.8 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.6 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.5 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.4 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.3 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.2 app/controllers/concerns/api/v1/users/controller_base.rb
bullet_train-api-1.1.1 app/controllers/concerns/api/v1/users/controller_base.rb