Skip to content

DeleteRestrictionError

class

Defined in src/ralph/errors.cr:279

Raised when trying to destroy a record with dependent: :restrict_with_exception

Example

class User < Ralph::Model
  has_many :posts, dependent: :restrict_with_exception
end

user.destroy # => Ralph::DeleteRestrictionError: Cannot delete User because posts exist

Constructors

.new(association : String)

View source