rules_controller.rb 345 B

1234567891011121314151617
  1. # frozen_string_literal: true
  2. class Api::V1::Instances::RulesController < Api::BaseController
  3. skip_before_action :require_authenticated_user!, unless: :whitelist_mode?
  4. before_action :set_rules
  5. def index
  6. render json: @rules, each_serializer: REST::RuleSerializer
  7. end
  8. private
  9. def set_rules
  10. @rules = Rule.ordered
  11. end
  12. end