Class: Glia::Errors::RemainingAssociationError
- Defined in:
- lib/glia/errors/client_errors.rb
Instance Attribute Summary
Attributes inherited from Error
#error_details, #message, #ref, #type
Instance Method Summary collapse
-
#initialize(resource:, associated_resource:, message: nil) ⇒ RemainingAssociationError
constructor
A new instance of RemainingAssociationError.
Methods inherited from Error
Constructor Details
#initialize(resource:, associated_resource:, message: nil) ⇒ RemainingAssociationError
Returns a new instance of RemainingAssociationError.
171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/glia/errors/client_errors.rb', line 171 def initialize(resource:, associated_resource:, message: nil) Naming.assert_snake_case(resource) Naming.assert_snake_case(associated_resource) = "cannot be modified/deleted because it is associated to one or more #{ Naming.humanize(associated_resource) }(s)" super( type: REMAINING_ASSOCIATION_ERROR, ref: create_ref(REMAINING_ASSOCIATION_ERROR), message: || "#{Naming.humanize(resource)} #{}", error_details: { resource: resource, associated_resource: associated_resource } ) end |