assignable? is just a filter to select roles that have attribute
assignable set to true.
Regarding roles... I want to select not all roles, but roles that are
members of project. And also I cannot change database structure. So I
have the following entities relations:
Roles - Members -
Thanks to Harold. I used uniq method and it worksfine!! :)
Thank you!
--
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
Yan Oleg wrote:
I have the following code:
members.select {|m| m.role.assignable?}.collect {|m| m.role}.sort
There are two tables: roles and members. One role record may have
many foreign member records.
But in this case I get many same roles, I want to apply distinct
operation to
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
[EMAIL PROTECTED] wrote:
Yan Oleg wrote:
I have the following code:
Ok, maybe we misunderstood each other.
If you want a list of roles, why would you go through the members
table to get it? You can just do Roles.find(:all).map(:name)
I'm not sure what you doing with assignable?. It seems to be
important to you, but you have not explained what it is supposed
5 matches
Mail list logo