Is multiply recipents allowed with Public_Activity gem?

526 views
Skip to first unread message

Huaxiang Man

unread,
Jun 26, 2013, 7:13:19 PM6/26/13
to public-...@googlegroups.com
I tried to create activities with "self.create_activity key: 'user.invite', owner:self, recipient:users". Actually I have a list of users, is it possible to group them together in recipients? So only one activity will be needed.

Gavin McQuistin

unread,
Jun 28, 2013, 11:52:30 AM6/28/13
to public-...@googlegroups.com
I tried to do something like this in the project I'm currently working on. My solution was to store the list of users in 'parameters' like this:

self.create_activity(key: 'user.invite', owner: self, parameters: {users: [1, 2, 3]})

I could then search for activities in which the current user id is found within the parameters hash:

PublicActivity::Activity.where({'parameters.user' => current_user.id})

If anyone has a better solution, please let us know! :)

Jakub Okoński

unread,
Jun 28, 2013, 11:57:02 AM6/28/13
to Gavin McQuistin, public-...@googlegroups.com
We don't support multiple recipients, but it's a polymorphic association, so you could create something like a Group to resemble many recipients.


--
You received this message because you are subscribed to the Google Groups "Public Activity" group.
To unsubscribe from this group and stop receiving emails from it, send an email to public-activi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

James Man

unread,
Jun 28, 2013, 5:00:22 PM6/28/13
to public-...@googlegroups.com
yes, that could be one way, we can put almost everything in parameters:)
Message has been deleted
Message has been deleted

surya teja

unread,
Jun 3, 2017, 9:16:16 AM6/3/17
to Public Activity
Reply all
Reply to author
Forward
0 new messages