summaryrefslogtreecommitdiff
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
parentec34b2d051c16a351387fbaedb5542654810b8a5 (diff)
downloadgitlab-ce-dev.non-referable-inspect.tar.gz
expose Referable#non_referable_inspectdev.non-referable-inspect
-rw-r--r--app/models/concerns/referable.rb9
-rw-r--r--app/models/user.rb5
2 files changed, 5 insertions, 9 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
#
diff --git a/app/models/user.rb b/app/models/user.rb
index 0e2654ff757..02c3ab6654b 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -47,11 +47,6 @@ class User < ActiveRecord::Base
devise :lockable, :recoverable, :rememberable, :trackable,
:validatable, :omniauthable, :confirmable, :registerable
- # devise overrides #inspect, so we manually use the Referable one
- def inspect
- referable_inspect
- end
-
# Override Devise::Models::Trackable#update_tracked_fields!
# to limit database writes to at most once every hour
def update_tracked_fields!(request)