Don't avoid the many-to-many
association, it's only about working with a join model
You can just use has_many :through
You'd just need to do this:
#app/models/prescription.rb
Class Prescription < ActiveRecord::Base
has_many :relations
has_many :medicines, through: :relations
end
#app/models/relation.rb
Class Relation < ActiveRecord::Base
belongs_to :prescription
belongs_to :medicine
end
#app/models/medicine.rb
Class Medicine < ActiveRecord::Base
has_many :relations
has_many :prescriptions, through: :relations
end