Get contributed projects only if push event exists

Conflicts:
	app/models/user.rb
This commit is contained in:
Dmitriy Zaporozhets
2015-02-18 15:55:28 -08:00
parent 87bf35df95
commit 8bf7a64b5f
2 changed files with 11 additions and 3 deletions
+10 -2
View File
@@ -255,7 +255,7 @@ class User < ActiveRecord::Base
counter = 0
base = username
while User.by_login(username).present? || Namespace.by_path(username).present?
counter += 1
counter += 1
username = "#{base}#{counter}"
end
@@ -459,7 +459,7 @@ class User < ActiveRecord::Base
def set_notification_email
if self.notification_email.blank? || !self.all_emails.include?(self.notification_email)
self.notification_email = self.email
self.notification_email = self.email
end
end
@@ -607,4 +607,12 @@ class User < ActiveRecord::Base
def oauth_authorized_tokens
Doorkeeper::AccessToken.where(resource_owner_id: self.id, revoked_at: nil)
end
def contributed_projects_ids
Event.where(author_id: self).
code_push.
reorder(project_id: :desc).
select('DISTINCT(project_id)').
map(&:project_id)
end
end
+1 -1
View File
@@ -1,4 +1,4 @@
%h4 Calendar
%h4 Commits calendar
#cal-heatmap.calendar
:javascript
new calendar(