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.
128 129 130 131 132 133 134 135 136 137 138 139 |
# File 'lib/glia/errors/client_errors.rb', line 128 def initialize(resource:, associated_resource:, message: nil) = "cannot be modified/deleted because it is associated to one or more #{ humanize(associated_resource) }(s)" super( type: REMAINING_ASSOCIATION_ERROR, ref: "https://example.com/errors/#{REMAINING_ASSOCIATION_ERROR}.html", message: "#{humanize(resource)} " + ( || ), error_details: { resource: resource, associated_resource: associated_resource } ) end |