Module: Workarea::Admin::Publishing

Extended by:
ActiveSupport::Concern
Included in:
ApplicationController
Defined in:
app/controllers/workarea/admin/publishing.rb

Instance Method Summary collapse

Instance Method Details

#allow_publishing!Object



15
16
17
# File 'app/controllers/workarea/admin/publishing.rb', line 15

def allow_publishing!
  @allow_publishing = true
end

#allow_publishing?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/controllers/workarea/admin/publishing.rb', line 11

def allow_publishing?
  @allow_publishing ||= current_user && current_user.can_publish_now?
end

#set_publishing_optionsObject



19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/workarea/admin/publishing.rb', line 19

def set_publishing_options
  return yield if request.get? || params[:publishing].blank?

  release = Release.find(params[:publishing]) rescue nil
  self.current_release = release if current_release != release
  yield

ensure
  Release.current = nil
end