Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send feed to participant #14

Open
ragrawal opened this issue Nov 20, 2011 · 0 comments
Open

Send feed to participant #14

ragrawal opened this issue Nov 20, 2011 · 0 comments

Comments

@ragrawal
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant