Sha256: df1781aede924be70f2fd25673219659d57d7399ce2cba045c77195676d38c64
Contents?: true
Size: 764 Bytes
Versions: 34
Compression:
Stored size: 764 Bytes
Contents
module Workarea class SavePublishing delegate :errors, to: :release, allow_nil: true def initialize(releasable, params) @releasable = releasable @params = params end def perform return false if release.present? && !release.valid? return true if @releasable.blank? Release.with_current(release.try(:id)) do @releasable.update_attributes!(active: activate?) end end def release return if @params[:activate].in?(%w(now never)) @release ||= if @params[:activate] == 'new_release' Release.create(@params[:release]) else Release.find(@params[:activate]) end end def activate? @params[:activate] != 'never' end end end
Version data entries
34 entries across 34 versions & 1 rubygems