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
3e695acf
Commit
3e695acf
authored
Mar 25, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Notes fixed
parent
e3351287
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
14 deletions
+29
-14
Gemfile.lock
Gemfile.lock
+14
-14
app/models/event.rb
app/models/event.rb
+4
-0
app/models/note.rb
app/models/note.rb
+6
-0
app/models/snippet.rb
app/models/snippet.rb
+1
-0
app/views/events/event/_note.html.haml
app/views/events/event/_note.html.haml
+4
-0
No files found.
Gemfile.lock
View file @
3e695acf
GIT
remote: https://github.com/ctran/annotate_models.git
revision: be4e26825b521f0b2d86b181e2dff89901aa9b1e
specs:
annotate (2.6.0.beta1)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
GIT
remote: https://github.com/gitlabhq/raphael-rails.git
revision: cb2c92a040b9b941a5f1aa1ea866cc26e944fe58
specs:
raphael-rails (2.1.0)
GIT
remote: https://github.com/gollum/gollum.git
revision: 5dcd3c8c8f68158e43ff79861279088ee56d0ebe
...
...
@@ -15,20 +29,6 @@ GIT
stringex (~> 1.5.1)
useragent (~> 0.4.16)
GIT
remote: https://github.com/ctran/annotate_models.git
revision: be4e26825b521f0b2d86b181e2dff89901aa9b1e
specs:
annotate (2.6.0.beta1)
activerecord (>= 2.3.0)
rake (>= 0.8.7)
GIT
remote: https://github.com/gitlabhq/raphael-rails.git
revision: cb2c92a040b9b941a5f1aa1ea866cc26e944fe58
specs:
raphael-rails (2.1.0)
GEM
remote: https://rubygems.org/
specs:
...
...
app/models/event.rb
View file @
3e695acf
...
...
@@ -259,6 +259,10 @@ class Event < ActiveRecord::Base
target
.
noteable_type
==
"Commit"
end
def
note_project_snippet?
target
.
noteable_type
==
"Snippet"
end
def
note_target
target
.
noteable
end
...
...
app/models/note.rb
View file @
3e695acf
...
...
@@ -170,4 +170,10 @@ class Note < ActiveRecord::Base
"wall"
end
end
# FIXME: Hack for polymorphic associations with STI
# For more information wisit http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#label-Polymorphic+Associations
def
noteable_type
=
(
sType
)
super
(
sType
.
to_s
.
classify
.
constantize
.
base_class
.
to_s
)
end
end
app/models/snippet.rb
View file @
3e695acf
...
...
@@ -20,6 +20,7 @@ class Snippet < ActiveRecord::Base
attr_accessible
:title
,
:content
,
:file_name
,
:expires_at
,
:private
belongs_to
:author
,
class_name:
"User"
has_many
:notes
,
as: :noteable
,
dependent: :destroy
delegate
:name
,
:email
,
to: :author
,
prefix:
true
,
allow_nil:
true
...
...
app/views/events/event/_note.html.haml
View file @
3e695acf
...
...
@@ -5,6 +5,10 @@
-
if
event
.
note_commit?
=
event
.
note_target_type
=
link_to
event
.
note_short_commit_id
,
project_commit_path
(
event
.
project
,
event
.
note_commit_id
),
class:
"commit_short_id"
-
if
event
.
note_project_snippet?
=
link_to
project_snippet_path
(
event
.
project
,
event
.
note_target
)
do
%strong
#{
event
.
note_target_type
}
##{truncate event.note_target_id}
-
else
=
link_to
[
event
.
project
,
event
.
note_target
]
do
%strong
...
...
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