Class: Glia::Errors::RemainingAssociationError
- Defined in:
- lib/glia/errors/client_errors.rb
Constant Summary
Constants inherited from Error
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.
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File 'lib/glia/errors/client_errors.rb', line 133 def initialize(resource:, associated_resource:, message: nil) assert_snake_case(resource) assert_snake_case(associated_resource) = "cannot be modified/deleted because it is associated to one or more #{ humanize(associated_resource) }(s)" super( type: REMAINING_ASSOCIATION_ERROR, ref: create_ref(REMAINING_ASSOCIATION_ERROR), message: || "#{humanize(resource)} #{default_message}", error_details: { resource: resource, associated_resource: associated_resource } ) end |