Avoid changing class variable in every request, fixes #296 using has_many :through from both sides of association