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

foodcoops / foodsoft / 9904740410

12 Jul 2024 08:19AM CUT coverage: 45.982% (-20.2%) from 66.201%
9904740410

Pull #1070

github

web-flow
Merge 6087995d4 into 58c8feed2
Pull Request #1070: fix: Add missing migration for articles table

2861 of 6222 relevant lines covered (45.98%)

0.97 hits per line

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

85.71
/app/models/membership.rb
1
class Membership < ApplicationRecord
1✔
2
  belongs_to :user
1✔
3
  belongs_to :group
1✔
4

5
  before_destroy :check_last_admin
1✔
6

7
  protected
1✔
8

9
  # check if this is the last admin-membership and deny
10
  def check_last_admin
1✔
11
    raise I18n.t('model.membership.no_admin_delete') if group.role_admin? && group.memberships.size == 1 && Group.where(role_admin: true).count == 1
×
12
  end
13
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

© 2024 Coveralls, Inc