Guest User

Untitled

a guest
Apr 19th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. class GitRidOfShadowing < DataMunger::Script
  2.  
  3. # a frozen copy of the required texpert functionality
  4. class Texpert < ActiveRecord::Base
  5. def unshadow!
  6. new_status = case self.status
  7. when "shadowing" then "texpert"
  8. when "deactived_shadowing" then "deactivated_texpert"
  9. end
  10.  
  11. if new_status
  12. self.status = new_status
  13. self.save(false)
  14. end
  15. end
  16. end
  17.  
  18. self.deployment_locations = [:us_master, :uk_master] # if this is omitted it happens in all locations
  19. self.environments = [:production, :staging] # if this is omitted it happens in all environments
  20.  
  21. def self.run
  22. Texpert.find_all_by_status("shadowing").each do |t|
  23. t.unshadow!
  24. end
  25. end
  26. end
Add Comment
Please, Sign In to add comment