From eca45bd4d23e01403b6a77d0c0cb259e43f6ae2d Mon Sep 17 00:00:00 2001 From: Kasper Timm Hansen Date: Wed, 6 Sep 2023 15:13:13 +0200 Subject: [PATCH] Cut to the point in exception messages --- .../concerns/bullet_train/loads_and_authorizes_resource.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bullet_train-super_load_and_authorize_resource/app/controllers/concerns/bullet_train/loads_and_authorizes_resource.rb b/bullet_train-super_load_and_authorize_resource/app/controllers/concerns/bullet_train/loads_and_authorizes_resource.rb index 0994a805d..7cc02e202 100644 --- a/bullet_train-super_load_and_authorize_resource/app/controllers/concerns/bullet_train/loads_and_authorizes_resource.rb +++ b/bullet_train-super_load_and_authorize_resource/app/controllers/concerns/bullet_train/loads_and_authorizes_resource.rb @@ -68,7 +68,7 @@ def account_load_and_authorize_resource(model, options, old_options = {}) namespace.pop retry else - raise "Oh no, it looks like your call to 'account_load_and_authorize_resource' is broken. We tried #{tried.join(" and ")}, but didn't find a valid class name." + raise "Your 'account_load_and_authorize_resource' is broken. We tried #{tried.join(" and ")}, but didn't find a valid class name." end end @@ -81,7 +81,7 @@ def account_load_and_authorize_resource(model, options, old_options = {}) # reflect on the belongs_to association of the child model to figure out the class names of the parents. association = model_class_name.constantize.reflect_on_association(through_as_symbol) unless association - raise "Oh no, it looks like your call to 'account_load_and_authorize_resource' is broken. Tried to reflect on the `#{through_as_symbol}` association of #{model_class_name}, but didn't find one." + raise "Your 'account_load_and_authorize_resource' is broken. Tried to reflect on the `#{through_as_symbol}` association of #{model_class_name}, but didn't find one." end through_class_name = association.klass.name @@ -90,7 +90,7 @@ def account_load_and_authorize_resource(model, options, old_options = {}) through << through_class_name.constantize through_class_names << through_class_name rescue NameError - raise "Oh no, it looks like your call to 'account_load_and_authorize_resource' is broken. We tried to load `#{through_class_name}}` (the class name defined for the `#{through_as_symbol}` association), but couldn't find it." + raise "Your 'account_load_and_authorize_resource' is broken. We tried to load `#{through_class_name}}` (the class name defined for the `#{through_as_symbol}` association), but couldn't find it." end end