Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # grep -r -i Tuple.find_by_value app/ test/ lib/ | grep -v \.svn | awk -F: '{print $1}' | sort -u | xargs ruby script/move_tuples.rb | sh -s
- require File.dirname(__FILE__) + '/../config/boot'
- require File.dirname(__FILE__) + '/../config/environment'
- require 'breakpoint'
- names= ['adjustment', 'applied', 'balanced', 'cash', 'claim_open', 'client',
- 'client_statement_open', 'closed', 'contractual', 'credit', 'debit', 'ffs',
- 'kept', 'lcsw', 'md', 'open', 'payment', 'pending_claim',
- 'pending_secondary_claim', 'system', 'third_party', 'write-off', 'write-up']
- change = {}
- names.each do |name|
- tuple = Tuple.find_by_value(name)
- unless tuple
- STDERR.puts "ERROR: Tuple.find_by_value(#{name}) finds no matches."
- else
- change[name] = tuple.path + '/' + name
- STDERR.puts "Mapping: tuple name [#{name}] => tuple path [#{change[name]}]"
- raise "Tuple name [#{name}] and path [#{change[name]}] don't resolve properly." unless Tuple.find_pathed(change[name]) == tuple
- end
- end
- change.keys.each {|k| puts %Q<perl -i.orig -pe "s%Tuple.find_by_value\\((.)#{k}(.)\\)%Tuple.find_pathed('#{change[k]}')%g" #{ARGV.join(' ')}> }
Add Comment
Please, Sign In to add comment