nobosh wrote:
> Continuing along this thread... I'm interested in creating a SCOPE in
> the project model (project.rb) that returns all the project's members
> (bassed on the permissions table <> users & role tables.
> 
> Desired output:
> user.name, role.name
> 
> Here's my scope in the model, which isn't returning the desired
> output:
> 
> class Project < ActiveRecord::Base
> has_many :permissions
> has_many :users, :through => :permissions
>  #Playing with Scopes
> 
>   scope :teammembers,
>   Project.permissions.joins(:users, :roles)
> 
> end
> 
> trying to figure out how to get the output with ActiveRecord. Thanks

You're making the exact same mistake as before.  Project.permissions 
just returns an array of Permission objects.

Best,
-- 
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

Sent from my iPhone
-- 
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 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