lib/sequel/model/exceptions.rb in sequel-4.44.0 vs lib/sequel/model/exceptions.rb in sequel-4.45.0
- old
+ new
@@ -13,21 +13,28 @@
end
end
# Alias for HookFailed, kept for backwards compatibility
BeforeHookFailed = HookFailed
+ Sequel::Deprecation.deprecate_constant(self, :BeforeHookFailed)
+ (
# Exception class raised when +require_modification+ is set and an UPDATE or DELETE statement to modify the dataset doesn't
# modify a single row.
NoExistingObject = Class.new(Error)
+ ).name
+ (
# Raised when an undefined association is used when eager loading.
UndefinedAssociation = Class.new(Error)
+ ).name
+ (
# Raised when a mass assignment method is called in strict mode with either a restricted column
# or a column without a setter method.
MassAssignmentRestriction = Class.new(Error)
+ ).name
# Exception class raised when +raise_on_save_failure+ is set and validation fails
class ValidationFailed < Error
# The Sequel::Model object related to this exception.
attr_reader :model
@@ -46,12 +53,7 @@
super(errors.full_messages.join(', '))
else
super
end
end
- end
-
- # Call name on each class to set the name for the class, so it gets cached.
- constants.map{|c| const_get(c)}.each do |c|
- Class === c && c.name
end
end