has_and_belongs_to_many is an older syntax and being deprecated so I changed this to has_many through