Skip to content

Instantly share code, notes, and snippets.

@stevenjackson
Created August 15, 2019 18:41
Show Gist options
  • Save stevenjackson/411de90edff6137c8de1951750ed1f82 to your computer and use it in GitHub Desktop.
Save stevenjackson/411de90edff6137c8de1951750ed1f82 to your computer and use it in GitHub Desktop.
ActiveRecord::HasManyThroughOrderError detector
ApplicationRecord.descendants.each do |model|
model.reflect_on_all_associations.each do |relation|
model.first&.send(relation.name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment