Class: Tasks::Content::PublisherController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Tasks::Content::PublisherController
- Includes:
- TaskControllerConfiguration
- Defined in:
- app/controllers/tasks/content/publisher_controller.rb
Instance Method Summary collapse
- #index ⇒ Object
- #publish_all ⇒ Object
- #summary ⇒ Object
- #topic_table ⇒ Object
- #unpublish_all ⇒ Object
Methods included from TaskControllerConfiguration
Instance Method Details
#index ⇒ Object
4 5 |
# File 'app/controllers/tasks/content/publisher_controller.rb', line 4 def index end |
#publish_all ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/tasks/content/publisher_controller.rb', line 14 def publish_all params.require(:topic_id) begin Content.transaction do Content.where(topic_id: params[:topic_id], project_id: sessions_current_project_id).each do |c| c.publish end end render 'topic_table' rescue ActiveRecord::RecordInvalid => e end end |
#summary ⇒ Object
7 8 |
# File 'app/controllers/tasks/content/publisher_controller.rb', line 7 def summary end |
#topic_table ⇒ Object
10 11 12 |
# File 'app/controllers/tasks/content/publisher_controller.rb', line 10 def topic_table params.require(:topic_id) end |
#unpublish_all ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/tasks/content/publisher_controller.rb', line 27 def unpublish_all params.require(:topic_id) begin Content.transaction do Content.where(topic_id: params[:topic_id], project_id: sessions_current_project_id).each do |c| c.unpublish end end render 'topic_table' rescue ActiveRecord::RecordInvalid => e end end |