Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
080cd74a
Commit
080cd74a
authored
Aug 03, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev.referable-inspect' into 'master'
implement #inspect for all Referables See merge request !13285
parents
9751349d
15643ff9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
app/models/concerns/referable.rb
app/models/concerns/referable.rb
+12
-0
app/models/user.rb
app/models/user.rb
+5
-0
No files found.
app/models/concerns/referable.rb
View file @
080cd74a
...
@@ -25,6 +25,18 @@ module Referable
...
@@ -25,6 +25,18 @@ module Referable
to_reference
(
from_project
)
to_reference
(
from_project
)
end
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
module
ClassMethods
# The character that prefixes the actual reference identifier
# The character that prefixes the actual reference identifier
#
#
...
...
app/models/user.rb
View file @
080cd74a
...
@@ -47,6 +47,11 @@ class User < ActiveRecord::Base
...
@@ -47,6 +47,11 @@ class User < ActiveRecord::Base
devise
:lockable
,
:recoverable
,
:rememberable
,
:trackable
,
devise
:lockable
,
:recoverable
,
:rememberable
,
:trackable
,
:validatable
,
:omniauthable
,
:confirmable
,
:registerable
: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!
# Override Devise::Models::Trackable#update_tracked_fields!
# to limit database writes to at most once every hour
# to limit database writes to at most once every hour
def
update_tracked_fields!
(
request
)
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