def attributes_for(action, subject)
      policy = context.send :policy, subject
      value = ModuleUtils.try_to(policy, "attributes_for_#{action}") || ModuleUtils.try_to(policy, 'attributes_for')
      Rails.logger.warn I18n.t('error.pundit.not_found.attributes_for', subject: subject) unless value
      value || {}
    end
def attributes_for(action, subject)
      policy = context.send :policy, subject
      value = ModuleUtils.try_to(policy, "attributes_for_#{action}") || ModuleUtils.try_to(policy, 'attributes_for')
      Rails.logger.warn I18n.t('error.pundit.not_found.attributes_for', subject: subject) unless value
      value || {}
    end
Restrict user to assign certain values.

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

 - attributes\_for\_#\{ action \}
 - attributes\_for
 @param action [Symbol, String]
 @param subject [Object]
 @return [Hash] field value paired hash that user's allowed to assign