def permit_params(action, subject)
      policy = context.send :policy, subject
      # @see https://github.com/varvet/pundit/blob/master/lib/pundit.rb#L258
      ModuleUtils.try_to(policy, "permitted_attributes_for_#{action}") \
        || ModuleUtils.try_to(policy, 'permitted_attributes')
    end
def permit_params(action, subject)
      policy = context.send :policy, subject
      # @see https://github.com/varvet/pundit/blob/master/lib/pundit.rb#L258
      ModuleUtils.try_to(policy, "permitted_attributes_for_#{action}") \
        || ModuleUtils.try_to(policy, 'permitted_attributes')
    end
Restrict user for mass assignment.

 It will do a lookup in policy's methods and pick the first available method:

 - permitted\_attributes\_for\_#\{ action \}
 - permitted\_attributes
 @param action [Symbol, String]
 @param subject [Object]
 @return [Array] field list that user's allowed to change.