After hours being baffled, the problem was just a couple of typos…
I spent hours yesterday trying to work out why a model in my uni project Mwungo, wasnt being updated correctly. Turns out it was a typo i had. Two of my database columns were named incorrectly. Very annoying. Part of the problem, in my opinion, is that the polymorphic associations rails has, which allow you to link up one model to many different models (for example, you can have an address model, and link that to a users model (users have many addresses), and also to a company model (companies have one address maybe)), dont seem to give an error if you misname the two fields you need to include for the relationship, the {relationshipname}_id and {relationshipname}_type fields. So when i was trying to create a new record, rails wasnt setting those values and the associated polymorphic model wasnt associated . Anyway. Glad i noticed reasonably early today. I guess i should report this as a bug now.







