diff options
author | Starfall <us@starfall.systems> | 2021-02-26 22:07:00 -0600 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2021-02-26 22:07:00 -0600 |
commit | 033b1b5b900babc9b068ddad0ae644c5f15e9ffe (patch) | |
tree | 76a4d5f8890836e855cccdf4ad7d58fd9c0159ee /app/controllers/api/v1/instances | |
parent | 35f9f9565e142b8c8e7541549046bad679f1438d (diff) | |
parent | 4aa860b65bd796b09dc0ceffa1fdd7de31060a34 (diff) |
Merge remote-tracking branch 'glitchsoc/main' into main
Diffstat (limited to 'app/controllers/api/v1/instances')
-rw-r--r-- | app/controllers/api/v1/instances/rules_controller.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/app/controllers/api/v1/instances/rules_controller.rb b/app/controllers/api/v1/instances/rules_controller.rb new file mode 100644 index 000000000..93cf3c759 --- /dev/null +++ b/app/controllers/api/v1/instances/rules_controller.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class Api::V1::Instances::RulesController < Api::BaseController + skip_before_action :require_authenticated_user!, unless: :whitelist_mode? + + before_action :set_rules + + def index + render json: @rules, each_serializer: REST::RuleSerializer + end + + private + + def set_rules + @rules = Rule.ordered + end +end |