Skip to content

Commit

Permalink
Improve error message when destroy fails [#3275]
Browse files Browse the repository at this point in the history
  • Loading branch information
mjy committed Oct 3, 2024
1 parent 29882e1 commit 71d141c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/character_state.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def target_name(target, language_id)

protected

def dependent_destroy_error_message
"Cannot delete this #{self.class.name} because it has associated #{dependent_models.class.name} records."
end

def descriptor_kind
errors.add(:descriptor, 'must be Descriptor::Qualitative') if descriptor && descriptor.type != 'Descriptor::Qualitative'
end
Expand Down

0 comments on commit 71d141c

Please sign in to comment.