The guidance in this post shows how to use rolify with pundit authorisations.
I'm trying to figure out how to this in my Rails app.
What's confusing me about the answer in the linked post is that the index action checks for
@user.has_role?(:admin) || @user.organisation == @organisation
Ruby allows you to leave out parenthesis, it's more like a coding style.
Normally we omit parenthesis when it comes to methods that are with keyword status in Ruby. (
attr_accessor etc.) for the rest methods, we can use
You can learn more on this here: Ruby Style Guide