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

uclibs / treatment_database / 35edbf93-fbf7-4423-89e0-ad80649fc362

22 Oct 2024 07:49PM UTC coverage: 98.675%. Remained the same
35edbf93-fbf7-4423-89e0-ad80649fc362

Pull #560

circleci

Janell-Huyck
Update links to rails links
Pull Request #560: Hotfix - Update nav links - PR to QA branch

100 of 103 branches covered (97.09%)

Branch coverage included in aggregate %.

496 of 501 relevant lines covered (99.0%)

37.06 hits per line

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

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

3
class UsersController < ApplicationController
4✔
4
  load_and_authorize_resource
4✔
5

6
  def index
4✔
7
    @users = User.all
7✔
8
  end
9

10
  def new
4✔
11
    @user = User.new
1✔
12
  end
13

14
  def edit
4✔
15
    @user = User.find(params[:id])
3✔
16
  end
17

18
  def create_user
4✔
19
    @user = User.new(user_params)
3✔
20

21
    if @user.save
3✔
22
      flash[:notice] = 'Successfully created User.'
2✔
23
      redirect_to users_path
2✔
24
    else
25
      flash.now[:notice] = @user.errors.full_messages.first
1✔
26
      redirect_back fallback_location: root_path
1✔
27
    end
28
  end
29

30
  def update
4✔
31
    @user = User.find(params[:id])
7✔
32

33
    if @user.update(user_params)
7✔
34
      flash[:notice] = 'User was successfully updated.'
6✔
35
      redirect_to users_path
6✔
36
    else
37
      flash.now[:alert] = @user.errors.full_messages.first
1✔
38
      render :edit
1✔
39
    end
40
  end
41

42
  private
4✔
43

44
  def user_params
4✔
45
    params.require(:user).permit(:id, :display_name, :email, :role, :account_active, :password, :password_confirmation)
10✔
46
  end
47
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