summaryrefslogtreecommitdiff
path: root/app/models/event.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-04 08:43:25 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-01-04 08:43:25 +0200
commitdccd8b6eaa8b2e98b0245262a8e39df8fb8ae634 (patch)
tree541a40fb2e84b24ab0c4ae39fa18b1b720e5d7c2 /app/models/event.rb
parent39ba934c0a65f571214998e056e925b61f389360 (diff)
downloadgitlab-ce-dccd8b6eaa8b2e98b0245262a8e39df8fb8ae634.tar.gz
Continue refactoring. Use repostory and team
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index a737bfb0626..d0ba61544d1 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -204,7 +204,7 @@ class Event < ActiveRecord::Base
# Max 20 commits from push DESC
def commits
- @commits ||= data[:commits].map { |commit| project.commit(commit[:id]) }.reverse
+ @commits ||= data[:commits].map { |commit| repository.commit(commit[:id]) }.reverse
end
def commits_count
@@ -225,14 +225,18 @@ class Event < ActiveRecord::Base
end
end
+ def repository
+ project.repository
+ end
+
def parent_commit
- project.commit(commit_from)
+ repository.commit(commit_from)
rescue => ex
nil
end
def last_commit
- project.commit(commit_to)
+ repository.commit(commit_to)
rescue => ex
nil
end