Skip to content
Snippets Groups Projects
Commit 6c224f54 authored by Marcela Ribeiro de Oliveira's avatar Marcela Ribeiro de Oliveira
Browse files

Merge branch 'master' of gitlab.c3sl.ufpr.br:portalmec/portalmec into rspec

parents ac226e2c 100f900d
No related branches found
No related tags found
No related merge requests found
......@@ -23,15 +23,17 @@ module Trackable
end
def new_destroy_activity
new_activity(:destroy)
params = { name: self.try(:name)}
new_activity(:destroy,params)
end
def new_activity(action)
def new_activity(action,params=nil)
create_activity(
action,
owner: activity_owner,
recipient: activity_recipient,
privacy: activity_privacy
privacy: activity_privacy,
parameters: params
)
end
......
......@@ -13,6 +13,10 @@ class UserSerializer < ActiveModel::Serializer
object.email if (current_user != nil)&&(object.id == current_user.id || current_user.is_admin?)
end
def learning_objects_count
object.learning_objects.where('state = ?', LearningObject.states[:published]).count
end
attributes :id, :email, :provider, :name, :description, :education, :score, :cover, :role_ids, :institution_ids, :avatar, :likes_count, :followed, :complained, :follows_count, :learning_objects_count, :collections_count, :created_at, :updated_at
has_many :subjects
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment