-
-
Save robins35/6732b56f9f8f9bb1b482c0a8938dfd13 to your computer and use it in GitHub Desktop.
Weird tinytds error causing activerecord error
This file contains 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
ActiveRecord::StatementInvalid: NoMethodError: undefined method `each' for false:FalseClass | |
... | |
export_org.rake:196:in `export_records_with_org_id' | |
Line 196 is the line that does record.send(association_name).each do |association_record| |
This file contains 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
association_names.to_a.each do |association_name| | |
puts "Exporting '#{association_name}' from '#{record.class} - #{record.id}'" | |
begin | |
record.send(association_name).each do |association_record| | |
export_record(association_record, pack_path, scp) | |
end | |
rescue TinyTds::Error => e | |
puts "#{e.class}: #{e.message}" | |
puts e.backtrace.join("\n") | |
File.open(File.join(pack_path, "overflow_errors.txt"), 'w') do |f| | |
f.write("Exporting '#{association_name}' from '#{record.class} - #{record.id}'") | |
end | |
rescue StandardError => e | |
puts "#{e.class}: #{e.message}" | |
puts e.backtrace.join("\n") | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment