I'm working with lists of names a User (current_user) manages lists of
names, some male some female (scoped on m or f in gender), it's all set
up such that I can do things like this - all working out fine.
(returns a list of the current users male names, pretty standard stuff I
a Name has the following attributes
What I'd like to do next is a little scary for me but I'm sure possible,
it is list comparison.
Basically for any given name, I'd like a method that returns other names
from *other users lists* where they have that given name in the list
(phew what a mouthful, not sure if that's explained correctly, I think
For example, I'd like to do this.
given user Bob has a list of male names like this
and user Sally has a list of male names like this
name = User.find_by_username('Bob').names.first
what I'd like is a method like this
which would return nil as no other users have 'robert'
name = User.find_by_username('Bob').names.last
This should return keith and paul from Sally's list.
sorry for the verbose message.
Confused if I should start with a class or instance method for starters!
Posted via http://www.ruby-forum.com/.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to email@example.com.
To unsubscribe from this group, send email to firstname.lastname@example.org.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.