Advertisement
Guest User

Untitled

a guest
Oct 1st, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. old_provider = restream.provider
  2. new_provider = ProviderType1.new old_provider.params_hash
  3. if new_provider.initialize_event == ProviderType1.SUCCESS_CODE
  4. # use buy-bug to check if #initialize_event was successful
  5. new_provider.save
  6. # check if new_provider can be persisted or have validation errors with "puts new_provider.errors"
  7. old_provider.destroy
  8. # restream should have nullified its provider automatically after it was destroyed. check here
  9. restream.provider = new_provider
  10. restream.save
  11. # check if restream.provider is the new_provider
  12. end
  13.  
  14. # If you manage to get the right provider after this, there's a chance you're investigating the wrong restream on your worker. Are you sure it's always supposed to be `channel.restreams.last` ?
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement