Class: DiscourseSubscriptionClient::SubscriptionsController

Inherits:
AdminController
  • Object
show all
Defined in:
app/controllers/discourse_subscription_client/subscriptions_controller.rb

Instance Method Summary collapse

Methods inherited from AdminController

#ensure_can_manage_subscriptions, #failed_json, #render_json_dump, #render_serialized, #serialize_data, #success_json

Instance Method Details

#indexObject



5
6
7
# File 'app/controllers/discourse_subscription_client/subscriptions_controller.rb', line 5

def index
  render_serialized(SubscriptionClientSubscription.all, SubscriptionSerializer, root: "subscriptions")
end

#updateObject



9
10
11
12
13
14
15
# File 'app/controllers/discourse_subscription_client/subscriptions_controller.rb', line 9

def update
  if DiscourseSubscriptionClient::Subscriptions.update
    render_serialized(SubscriptionClientSubscription.all, SubscriptionSerializer, root: "subscriptions")
  else
    render json: failed_json
  end
end