Sha256: f7b8e3ec42ac51dea604bc99bce451b08c964530bcf308c70f3cf8bfc82f184a

Contents?: true

Size: 881 Bytes

Versions: 1

Compression:

Stored size: 881 Bytes

Contents

module SpreeIdVerification
  module Spree
    module Admin

      module UsersControllerDecorator
        def verification
          @user = ::Spree::User.find(params[:id])
        end

        def verify
          @user = ::Spree::User.find(params[:id])
          if @user.status.blank?
            @user.status = 'pending'
          end
          @user.verify!

          render :verification
        end

        def reject
          @user = ::Spree::User.find(params[:id])
          if @user.status.blank?
            @user.status = 'pending'
          end
          @user.reject!

          render :verification
        end
      end

    end
  end
end

::Spree::Admin::UsersController.prepend SpreeIdVerification::Spree::Admin::UsersControllerDecorator if ::Spree::Admin::UsersController.included_modules.exclude?(SpreeIdVerification::Spree::Admin::UsersControllerDecorator)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree_id_verification-0.0.1.alpha app/controllers/spree_id_verification/spree/admin/users_controller_decorator.rb