Commit 7d26e4e3 authored by Zsolt Benke's avatar Zsolt Benke
Browse files

Fix deleting clients

parent f2ec63ec
Pipeline #21673 passed with stage
in 34 minutes and 6 seconds
......@@ -122,7 +122,7 @@ class Client < ApplicationRecord
end
def destroyable?
assignments.unscoped.blank?
assignments.with_deleted.blank?
end
private
......@@ -136,7 +136,7 @@ class Client < ApplicationRecord
def initialize(client)
@client = client
assignment_ids = @client.assignments.unscoped.pluck(:id).join(', ')
assignment_ids = @client.assignments.with_deleted.pluck(:id).join(', ')
message = "There are one or more assignment associated: #{assignment_ids}"
super(message)
end
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment