Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
e6f0f4cd039b
Commit
f656d4eb
authored
Aug 16, 2017
by
http://jneen.net/
Browse files
expose Referable#non_referable_inspect
parent
a0d9c45248b3
Changes
2
Hide whitespace changes
Inline
Side-by-side
app/models/concerns/referable.rb
View file @
e6f0f4cd
...
...
@@ -25,6 +25,11 @@ def reference_link_text(from_project = nil)
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 @@ def referable_inspect
end
end
def
inspect
referable_inspect
end
module
ClassMethods
# The character that prefixes the actual reference identifier
#
...
...
app/models/user.rb
View file @
e6f0f4cd
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment