Skip to content

Instantly share code, notes, and snippets.

@robins35
Created March 12, 2021 23:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robins35/6732b56f9f8f9bb1b482c0a8938dfd13 to your computer and use it in GitHub Desktop.
Save robins35/6732b56f9f8f9bb1b482c0a8938dfd13 to your computer and use it in GitHub Desktop.
Weird tinytds error causing activerecord error
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|
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