danielweinmann/unlock

View on GitHub
app/controllers/users_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
class UsersController < ApplicationController
  
  before_action :set_user

  respond_to :html

  after_action :verify_policy_scoped, only: %i[]
  before_action :authenticate_user!
  
  def my_contributions
    authorize @user
    @contributions = @user.contributions.not_pending
    @active = @contributions.with_state(:active)
    @suspended = @contributions.with_state(:suspended)
    respond_with @user
  end

  def my_initiatives
    authorize @user
    respond_with @user
  end

  private

  def set_user
    @user = current_user
  end

end