class User

has_many :friendships
has_many :friends, :through =>  :friendship
end


class Friendship
  belongs_to :user
  belongs_to :friend, :class_name => 'User'
  named_scope :accepted, :conditons => "is_accepted = true"
  named_scope :pending, :conditons => "is_accepted = false"
end

Here in the User class, i want to write
has_many :pending_friends, through a named scope friendships accepted
has_many:accepted_friends through a named scope pending

Please help,
Regards,
Pankaj
--~--~---------~--~----~------------~-------~--~----~
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 protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to