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
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
Thanks Marnen, obviously it hasn't clicked yet but I'll get it! Am I
at least right trying to get this to work as a Scope in the Project's
model, so I can have the controller pass the team members array to the
Controller to the view projects> show.html.erb?