Class: Sbmt::Outbox::Api::InboxClassesController
- Inherits:
-
BaseController
- Object
- BaseController
- Sbmt::Outbox::Api::InboxClassesController
- Defined in:
- app/controllers/sbmt/outbox/api/inbox_classes_controller.rb
Instance Method Summary collapse
Instance Method Details
#destroy ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/sbmt/outbox/api/inbox_classes_controller.rb', line 27 def destroy record = Sbmt::Outbox::Api::InboxClass.find(params.require(:id)) unless record render_ok return end record.destroy render_one record end |
#index ⇒ Object
7 8 9 10 11 |
# File 'app/controllers/sbmt/outbox/api/inbox_classes_controller.rb', line 7 def index render_list(Sbmt::Outbox.inbox_item_classes.map do |item| Sbmt::Outbox::Api::InboxClass.find_or_initialize(item.box_id) end) end |
#show ⇒ Object
13 14 15 |
# File 'app/controllers/sbmt/outbox/api/inbox_classes_controller.rb', line 13 def show render_one Sbmt::Outbox::Api::InboxClass.find_or_initialize(params.require(:id)) end |
#update ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/sbmt/outbox/api/inbox_classes_controller.rb', line 17 def update record = Sbmt::Outbox::Api::InboxClass.find_or_initialize(params.require(:id)) record.assign_attributes( params.require(:inbox_class).permit(:polling_enabled) ) record.save render_one record end |