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

uclibs / application_portfolio / 22736489347

05 Mar 2026 08:58PM UTC coverage: 70.141% (+0.2%) from 69.925%
22736489347

Pull #413

circleci

Janell-Huyck
CI: force Ruby platform and reinstall gems in GitHub Actions

Avoid GemNotFound for nokogiri/sqlite3/ffi on Linux by running
bundle config set --local force_ruby_platform true and bundle install
after setup-ruby, so the lockfile's ruby platform is used instead of
restored cache from another platform.

Made-with: Cursor
Pull Request #413: Libappo1 80 update nokogiri to 1 19

1 of 1 new or added line in 1 file covered. (100.0%)

1 existing line in 1 file now uncovered.

747 of 1065 relevant lines covered (70.14%)

23.0 hits per line

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

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

3
# UsersController
4
class UsersController < ApplicationController
2✔
5
  include ApplicationHelper
2✔
6
  include SoftwareRecordsHelper
2✔
7
  before_action :retrieve_user, only: %i[show edit update destroy user_status]
2✔
8
  before_action :authenticate_user!
2✔
9
  before_action :navigation, except: %i[edit update]
2✔
10
  access root_admin: :all,
2✔
11
         message: 'Permission Denied ! <br/> Please contact the administrator for more info.'
12
  helper_method :sort_column, :sort_direction
2✔
13

14
  def index
2✔
15
    @users = User.order("#{sort_column} #{sort_direction}")
4✔
16
    @active = 'users'
4✔
17
    $page_title = 'Manage Users | UCL Application Portfolio'
4✔
18
  end
19

20
  def edit
2✔
21
    $page_title = 'Edit Users | UCL Application Portfolio'
2✔
22
    render :edit
2✔
23
  end
24

25
  def update
2✔
26
    $page_title = 'Edit Users | UCL Application Portfolio'
2✔
27
    @user.first_name = params[:first_name]
2✔
28
    @user.last_name = params[:last_name]
2✔
29
    @user.title = params[:title]
2✔
30
    @user.department = params[:department]
2✔
31
    @user.email = params[:email]
2✔
32
    @user.roles = params[:roles]
2✔
33
    @user.active = params[:active]
2✔
34
    if !@user.changed? && @user.save
2✔
35
      redirect_to user_edit_path(params[:id]), alert: 'Please modify any field to update the User.'
×
36
    elsif @user.changed? && @user.save
2✔
UNCOV
37
      redirect_to users_show_path(params[:id]), notice: 'User was successfully updated.'
×
38
    else
39
      render :edit
2✔
40
    end
41
  end
42

43
  def show
2✔
44
    $page_title = "#{@user.first_name} #{@user.last_name} | UCL Application Portfolio"
2✔
45
    render :show
2✔
46
  end
47

48
  def retrieve_user
2✔
49
    @user = User.find(params[:id])
12✔
50
    @controller = params[:controller]
12✔
51
  end
52

53
  def user_status
2✔
54
    if @user.active.to_s == 'true'
4✔
55
      @user.active = false
4✔
56
      @user.save
4✔
57
      redirect_to users_show_path(params[:id]), notice: 'User was successfully de-activated.'
4✔
58
    else
59
      @user.active = true
×
60
      @user.save
×
61
      redirect_to users_show_path(params[:id]), notice: 'User was successfully activated.'
×
62
    end
63
  end
64

65
  def destroy
2✔
66
    if @user.destroy
2✔
67
      redirect_to session[:previous], notice: 'User was successfully deleted.'
2✔
68
    else
69
      render :index
×
70
    end
71
  end
72

73
  private
2✔
74

75
  def sort_column
2✔
76
    User.column_names.include?(params[:sort]) ? params[:sort] : 'first_name'
8✔
77
  end
78

79
  def sort_direction
2✔
80
    %w[asc desc].include?(params[:direction]) ? params[:direction] : 'asc'
8✔
81
  end
82
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