Ankur wrote:
> Hi !
>
> According to your relationships: resource :has_many => roles
> but you are using pro.roles. It means project should has many
> roles.Its totally wrong accordingly.
>
>
> First fetch all project_resources for a particular project. Eg.
>
> pr_resources = Project.find(1).p
Hi !
According to your relationships: resource :has_many => roles
but you are using pro.roles. It means project should has many
roles.Its totally wrong accordingly.
First fetch all project_resources for a particular project. Eg.
pr_resources = Project.find(1).project_resources
pr_resources wi
As seen from above in Project class there is no relation ship defined
for role so how can you expect the result from it.
Add has_many :roles, :through => :projects_ressources
and the required output will be produced.
On Jan 7, 10:54 am, Sven Schleier wrote:
> Hello,
> I'm doing right now my fir
> But I want also to know the roles of this ressources. How can I get now
> the roles of the ressources to this project with id 1? This doesn't
> work:
>
>>> role = pro.roles
>
> produces this error in the console:
>
> NoMethodError: undefined method `roles' for #
> from
> c:/Ruby/lib/r
4 matches
Mail list logo