Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix referencing wrong aliases while joining tables of has many through association #19452
Fix for Issue #19276.
While joining table of has_many :through association, ActiveRecord will use the actual table name instead of through-join alias. It results with a wrong SQL and exception is raised. This only happens when calculation methods like #count is called.
This bug is affecting Rails 4.1.x and 4.2.x as well.