Skip to content

Commit

Permalink
Merge pull request #198 from munen/feature/72289230/override-in-any-s…
Browse files Browse the repository at this point in the history
…tate

allow to transcend from prelive or postlive to archived
  • Loading branch information
munen committed Jun 4, 2014
2 parents 8296455 + 1a08809 commit 0d64c55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/models/talk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class Talk < ActiveRecord::Base
end
event :archive, timestamp: :processed_at do
transitions from: :processing, to: :archived
# in rare case we might to override a talk
# which has never been postprocessed
transitions from: :postlive, to: :archived
# or which has never even happended
transitions from: :prelive, to: :archived
end
end

Expand Down Expand Up @@ -412,6 +417,8 @@ def process_override!(uat=false)
chain ||= Setting.get('audio.override_chain')
chain = chain.split(/\s+/)
run_chain! chain, uat

archive! unless archived?
end

def run_chain!(chain, uat=false)
Expand Down

0 comments on commit 0d64c55

Please sign in to comment.