Hello,
For a user I have the following as an example:
[#<Permission id: 1, project_id: 3, role_id: 1, user_id: 1>, #<Permission id: 43, project_id: 2, role_id: 1, user_id: 1>, #<Permission id: 44, project_id: 4, role_id: 1, user_id: 1>, #<Permission id: 45, project_id: 5, role_id: 2, user_id: 1>, #<Permission id: 46, project_id: 6, role_id: 3, user_id: 1>, #<Permission id: 47, project_id: 7, role_id: 1, user_id: 1>]
I'm able to do this:
<% if results.permissions.empty? %>
Which tells me if the results.permissions has 1 or more records.
But what I'd like to do is something like this:
<% if results.permissions.where(spaceid = 3).empty? %>
What I'm trying to do is take a project_id variable and filter that with the results.permission object.
Suggestions?
Thanks!