alecguintu / mongoid_follow

Add basic "follow" features to rails3 + mongoid
https://github.com/alecguintu/mongoid_follow
MIT License
19 stars 16 forks source link

access the attributes of the follower or the followed #1

Closed hyperrjas closed 12 years ago

hyperrjas commented 12 years ago

How I can I access the attributes of my followers? or how can an object that is followed to access the attributes of his follower?

alecguintu commented 12 years ago

You can do an iteration on the list of followers the user has, like:

user.followers.each do |follower|
  puts follower.name

  puts follower.inspect
end

and sorry about the late reply regarding the demo you emailed me, but I don't have a demo online right now. But the description summarizes most of its functions. You can also check out the rspecs here for other test samples.

Cheers! alec guintu

hyperrjas commented 12 years ago

Thanks. That it does works fine :D. Thank you very much!.

hyperrjas commented 12 years ago

For me it does works this method "all_followers". e.g.

user.all_followers.each do |follower| follower.name follower.inspect end

alecguintu commented 12 years ago

Ahahaha! That was funny. Yah I forgot it was named like that.

Cheers!