Skip to content

Send feed to participant #14

@ragrawal

Description

@ragrawal

Consider a where User A completed some task for User B. In this case I want to create pfeed for both user A and User B. I sent orignator to User A and participant to User B and have a participant method to return User B as one of the person to which the pfeedItem should be delivered. However, deliver method in pfeed only calls the orignator object without passing itself and there is no way for the orignator object to return the participant. I have changed deliver method as follows to send the pfeedItem itself

def deliver(ar_obj,method_name_arr)
method_name_arr.map { |method_name|
if ar_obj.method(method_name).arity > 0
ar_obj.send(method_name, self)
else
ar_obj.send(method_name)
end
}.flatten.uniq.map {|o| deliver_to(o) }.compact
end

Let me know if there is a better to do that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions