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

codebar / planner / 14651308072

24 Apr 2025 08:43PM UTC coverage: 95.056%. Remained the same
14651308072

Pull #2208

github

web-flow
Merge 7d3ddd861 into bf68ec3ca
Pull Request #2208: Edit and Delete Member notes

22 of 23 new or added lines in 3 files covered. (95.65%)

3230 of 3398 relevant lines covered (95.06%)

90.66 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
  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 member_note_params
2✔
12
    params.require(:member_note).permit(:note, :member_id)
8✔
13
  end
14

15
  def edit; end
2✔
16
  
17
  def update
2✔
18
    @note = MemberNote.find(params[:id])
4✔
19
    authorize @note
4✔
20
  
21
    if @note.update(member_note_params)
4✔
22
      flash[:notice] = "Note updated successfully."
2✔
23
      redirect_to admin_member_path(@note.member)
2✔
24
    else
25
      flash[:error] = @note.errors.full_messages unless @note.save
2✔
26
      redirect_back fallback_location: root_path
2✔
27
    end
28
  end
29

30
  def destroy
2✔
31
    @note = MemberNote.find(params[:id])
2✔
32
    authorize @note
2✔
33
    if @note.destroy
2✔
34
      flash[:notice] = "Note successfully deleted."
2✔
35
    else
NEW
36
      flash[:error] = "Failed to delete note."
×
37
    end
38
    redirect_back fallback_location: root_path
2✔
39
  end
40
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