fine prior to 5.1
class A < ApplicationRecord
has_many :foo, through: :boo
has_many :boo
ActiveRecord::HasManyThroughOrderError for 5.1 and up rails/rails#29123
class A < ApplicationRecord
has_many :foo, through: :boo
has_many :boo
correct for 5.1+
class A < ApplicationRecord
has_many :boo
has_many :foo, through: :boo