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

uclibs / treatment_database / 97f905c7-fc42-4a0b-8157-2a2f32a383d8

14 Oct 2024 05:42PM UTC coverage: 98.841% (+0.4%) from 98.394%
97f905c7-fc42-4a0b-8157-2a2f32a383d8

push

circleci

web-flow
Updates Changelog. (#558)

Co-authored-by: Thomas Scherz <scherztc@ucmail.uc.edu>

101 of 103 branches covered (98.06%)

Branch coverage included in aggregate %.

496 of 501 relevant lines covered (99.0%)

42.87 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