Class: Tasks::Content::PublisherController

Inherits:
ApplicationController
  • Object
show all
Includes:
TaskControllerConfiguration
Defined in:
app/controllers/tasks/content/publisher_controller.rb

Instance Method Summary collapse

Methods included from TaskControllerConfiguration

#set_is_task_controller

Instance Method Details

#indexObject



4
5
# File 'app/controllers/tasks/content/publisher_controller.rb', line 4

def index
end

#publish_allObject



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

#summaryObject



7
8
# File 'app/controllers/tasks/content/publisher_controller.rb', line 7

def summary
end

#topic_tableObject



10
11
12
# File 'app/controllers/tasks/content/publisher_controller.rb', line 10

def topic_table
  params.require(:topic_id)
end

#unpublish_allObject



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