James Mitchell wrote:
> What exactly are you trying to do?
> 
> From reading what you wrote, it sounds like you want a list of roles
> that have not already been assigned.  Is that right?
> 
> --
> James Mitchell
> 
> 
> 
> On Fri, Nov 21, 2008 at 8:59 AM, Yan Oleg

NO, it isn't right.

If I use this code:

members.select {|m| m.role.assignable?}.collect {|m| m.role}.sort

...I get several roles with the same ID and NAME, but I want to get 
unique ones, like using DISTINCT operation in SQL statements (SELECT 
DISTINCT name FROM roles.....)

But unfortunately I can get the list from table "members", where records 
may have several same role names:

Manager
Tester
Manager
Manager
Manager
Tester
Developer
Developer
Tester
Developer
Tester
Developer
Developer
Developer

But I have to get this list:

Manager
Tester
Developer
-- 
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 rubyonrails-talk@googlegroups.com
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