summaryrefslogtreecommitdiffstats
path: root/app/helpers/icons_helper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/helpers/icons_helper.rb')
-rw-r--r--app/helpers/icons_helper.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/helpers/icons_helper.rb b/app/helpers/icons_helper.rb
index f423a2898..99006308e 100644
--- a/app/helpers/icons_helper.rb
+++ b/app/helpers/icons_helper.rb
@@ -45,7 +45,10 @@ module IconsHelper
end
end
- def principal_icon(principal_class, **options)
+ def principal_icon(principal, **options)
+ raise ArgumentError, "First argument has to be a Principal, was #{principal.inspect}" unless principal.is_a?(Principal)
+
+ principal_class = principal.class.name.downcase
sprite_icon('group', **options) if ['groupanonymous', 'groupnonmember', 'group'].include?(principal_class)
end