• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uclibs / treatment_database / 2ed3c114-bc57-4a8f-be70-bcf6c5a1cdc2

06 May 2025 02:54PM UTC coverage: 99.536%. Remained the same
2ed3c114-bc57-4a8f-be70-bcf6c5a1cdc2

push

circleci

Janell-Huyck
Bump rubocop-rails from 2.30.3 to 2.31.0

Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.30.3 to 2.31.0.
- [Release notes](https://github.com/rubocop/rubocop-rails/releases)
- [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.30.3...v2.31.0)

---
updated-dependencies:
- dependency-name: rubocop-rails
  dependency-version: 2.31.0
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

644 of 647 relevant lines covered (99.54%)

51.69 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/app/controllers/admin/users_controller.rb
1
# frozen_string_literal: true
2

3
module Admin
3✔
4
  class UsersController < ApplicationController
3✔
5
    before_action :authorize_admin
3✔
6
    before_action :set_user, only: %i[show edit update destroy]
3✔
7

8
    def index
3✔
9
      @users = User.all
11✔
10
    end
11

12
    def show; end
3✔
13

14
    def new
3✔
15
      @user = User.new
2✔
16
    end
17

18
    def edit; end
3✔
19

20
    def create
3✔
21
      @user = User.new(user_params)
4✔
22

23
      if @user.save
4✔
24
        redirect_to admin_users_path, notice: 'User created successfully.'
3✔
25
      else
26
        flash.now[:alert] = 'There was a problem creating the user. Please check the errors below.'
1✔
27
        render :new
1✔
28
      end
29
    end
30

31
    def update
3✔
32
      if @user.update(user_params)
9✔
33
        redirect_to admin_users_path, notice: 'Profile updated successfully.'
8✔
34
      else
35
        flash.now[:alert] = 'There was a problem editing the user. Please check the errors below.'
1✔
36
        render :edit
1✔
37
      end
38
    end
39

40
    def destroy
3✔
41
      redirect_to admin_users_path, alert: 'User deletion is not permitted.'
1✔
42
    end
43

44
    private
3✔
45

46
    def set_user
3✔
47
      @user = User.find(params[:id])
16✔
48
    end
49

50
    def authorize_admin
3✔
51
      redirect_to root_path, alert: 'Access denied.' unless admin?
33✔
52
    end
53

54
    def user_params
3✔
55
      permitted_attributes = %i[username display_name]
13✔
56
      permitted_attributes += %i[role account_active] if admin?
13✔
57
      params.require(:user).permit(permitted_attributes)
13✔
58
    end
59
  end
60
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc