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

codebar / planner / 17031900444

18 Aug 2025 05:30AM UTC coverage: 95.18% (-0.001%) from 95.181%
17031900444

Pull #2208

github

web-flow
Merge 6c737f55f into 6fee57120
Pull Request #2208: Edit and Delete Member notes

20 of 21 new or added lines in 3 files covered. (95.24%)

3219 of 3382 relevant lines covered (95.18%)

82.4 hits per line

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

96.0
/app/controllers/admin/member_notes_controller.rb
1
class Admin::MemberNotesController < Admin::ApplicationController
2✔
2
  before_action :authorize_note, only: %i[update destroy]
2✔
3

4
  def create
2✔
5
    @note = MemberNote.new(member_note_params)
4✔
6
    authorize @note
4✔
7

8
    @note.author = current_user
4✔
9
    flash[:error] = @note.errors.full_messages unless @note.save
4✔
10
    redirect_back fallback_location: root_path
4✔
11
  end
12

13
  def edit; end
2✔
14

15
  def update
2✔
16
    if @note.update(member_note_params)
4✔
17
      flash[:notice] = 'Note successfully updated.'
2✔
18
      redirect_to admin_member_path(@note.member)
2✔
19
    else
20
      flash[:error] = @note.errors.full_messages unless @note.save
2✔
21
      redirect_back fallback_location: root_path
2✔
22
    end
23
  end
24

25
  def destroy
2✔
26
    if @note.destroy
2✔
27
      flash[:notice] = 'Note successfully deleted.'
2✔
28
    else
NEW
29
      flash[:error] = 'Failed to delete note.'
×
30
    end
31
    redirect_back fallback_location: root_path
2✔
32
  end
33

34
  def authorize_note
2✔
35
    @note = MemberNote.find(params[:id])
6✔
36
    authorize @note
6✔
37
  end
38

39
  def member_note_params
2✔
40
    params.require(:member_note).permit(:note, :member_id)
8✔
41
  end
42
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