Please read for an updated status on RailsCasts:
Learn more or hide this
GitHub User: cam-stitt
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.
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.
return true if controller == "projects" && action.in?(%w) && 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?
to_tsvector('english', title) @@ to_tsquery('english', :q)
I can confirm that this method works. Thanks for the example.