summaryrefslogtreecommitdiff
path: root/app/models/concerns/referable.rb
diff options
context:
space:
mode:
authorhttp://jneen.net/ <jneen@jneen.net>2017-08-16 12:02:38 -0700
committerhttp://jneen.net/ <jneen@jneen.net>2017-08-16 12:02:38 -0700
commitf656d4ebc6afeb193fb76454e2fd5c4ad7cbe851 (patch)
tree2355c9f15039d75ebf343415524aef0a04d241b9 /app/models/concerns/referable.rb
parentec34b2d051c16a351387fbaedb5542654810b8a5 (diff)
downloadgitlab-ce-f656d4ebc6afeb193fb76454e2fd5c4ad7cbe851.tar.gz
expose Referable#non_referable_inspectdev.non-referable-inspect
Diffstat (limited to 'app/models/concerns/referable.rb')
-rw-r--r--app/models/concerns/referable.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/app/models/concerns/referable.rb b/app/models/concerns/referable.rb
index 10f4be72016..78ac4f324e7 100644
--- a/app/models/concerns/referable.rb
+++ b/app/models/concerns/referable.rb
@@ -25,6 +25,11 @@ module Referable
to_reference(from_project)
end
+ included do
+ alias_method :non_referable_inspect, :inspect
+ alias_method :inspect, :referable_inspect
+ end
+
def referable_inspect
if respond_to?(:id)
"#<#{self.class.name} id:#{id} #{to_reference(full: true)}>"
@@ -33,10 +38,6 @@ module Referable
end
end
- def inspect
- referable_inspect
- end
-
module ClassMethods
# The character that prefixes the actual reference identifier
#