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

codebar / planner / 16943964322

13 Aug 2025 04:56PM UTC coverage: 95.151% (-0.03%) from 95.181%
16943964322

Pull #2276

github

web-flow
Merge 42d00845e into 986142e3d
Pull Request #2276: Allow admins to edit and delete member notes

17 of 19 new or added lines in 3 files covered. (89.47%)

3218 of 3382 relevant lines covered (95.15%)

82.39 hits per line

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

95.65
/app/controllers/admin/member_notes_controller.rb
1
class Admin::MemberNotesController < Admin::ApplicationController
2✔
2
  def create
2✔
3
    @note = MemberNote.new(member_note_params)
4✔
4
    authorize @note
4✔
5

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

11
  def update
2✔
12
    @note = MemberNote.find(params[:id])
4✔
13
    authorize @note
4✔
14

15
    if @note.update(member_note_params)
4✔
16
      flash[:notice] = 'Note updated successfully.'
2✔
17
    else
18
      flash[:error] = @note.errors.full_messages.to_sentence
2✔
19
    end
20

21
    redirect_back fallback_location: root_path
4✔
22
  end
23

24
  def destroy
2✔
25
    @note = MemberNote.find(params[:id])
2✔
26
    authorize @note
2✔
27
    if @note.destroy
2✔
28
      flash[:notice] = 'Note deleted successfully.'
2✔
29
    else
NEW
30
      flash[:alert] = 'Failed to delete the note.'
×
31
    end
32
    redirect_back fallback_location: root_path
2✔
33
  end
34

35
  def member_note_params
2✔
36
    params.require(:member_note).permit(:note, :member_id)
8✔
37
  end
38
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

© 2025 Coveralls, Inc