summaryrefslogtreecommitdiff
path: root/app/models/concerns/referable.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/concerns/referable.rb')
-rw-r--r--app/models/concerns/referable.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/concerns/referable.rb b/app/models/concerns/referable.rb
index da803c7f481..10f4be72016 100644
--- a/app/models/concerns/referable.rb
+++ b/app/models/concerns/referable.rb
@@ -25,6 +25,18 @@ module Referable
to_reference(from_project)
end
+ def referable_inspect
+ if respond_to?(:id)
+ "#<#{self.class.name} id:#{id} #{to_reference(full: true)}>"
+ else
+ "#<#{self.class.name} #{to_reference(full: true)}>"
+ end
+ end
+
+ def inspect
+ referable_inspect
+ end
+
module ClassMethods
# The character that prefixes the actual reference identifier
#