I am sure you will put this in Part 2, but I am implementing this in an app right now and needed a way to ensure they were an admin for the associated member they were viewing.
ruby
if !current_permission.allow?(params[:controller], params[:action], params[:id])
Then you can use the Id to fetch and check on an item if needed.
ruby
returntrueif controller == "projects" && action.in?(%w[edit]) && Project.find(id).user == user
I was having issues with upper/lower case searching with pg_search. I then went and changed my query to match something like to_tsvector('english', title) @@ to_tsquery('english', :q) and it worked. Do you have any ideas why this would be the case?
Only just checked back, and will now be watching Part 2. Can fix up my dodgy fix :)
I am sure you will put this in Part 2, but I am implementing this in an app right now and needed a way to ensure they were an admin for the associated member they were viewing.
Then you can use the Id to fetch and check on an item if needed.
I was having issues with upper/lower case searching with pg_search. I then went and changed my query to match something like
to_tsvector('english', title) @@ to_tsquery('english', :q)
and it worked. Do you have any ideas why this would be the case?I can confirm that this method works. Thanks for the example.