Created
April 30, 2014 20:20
-
-
Save LBRapid/11437277 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
$stdout.sync = true | |
require File.join(File.expand_path('../..', __FILE__), %w[lib falkor]) | |
puts 'You should not run this command with any worker running. Are all workers stopped [y/n]?' | |
exit 0 unless 'y' == gets.chomp.downcase | |
puts 'Update all legacy transforms [y/n]?' | |
def update_legacy_transforms_for_flow(flow) | |
return if flow.tranforms.empty? | |
new_transforms = [] | |
flow.transforms.each do |transform| | |
transform.source = transform.source.to_s.prepend("//nomustache\r\n") | |
new_transforms << transform | |
end | |
flow.transforms = new_transforms | |
flow.save | |
puts "Successfully migrated transforms for flow #{flow.name}!" | |
end | |
if 'y' == gets.chomp.downcase | |
Flow.unscoped.all.each { |flow| update_legacy_transforms_for_flow(flow) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment