This should work: ```ruby def self.has_and_belongs_to_many(other, opts = {}) has_many other, opts.merge(through: [other, table_name].sort.join('_')) end if RUBY_ENGINE == 'opal' ```