I have two tables in MySQL: football_fixtures and weekly_fixtures.
In my code I have two classes
the WeeklyFixture class has more code than this, mostly validation
In the console window I do this
wf = WeeklyFixture.new
wf.somefield = somevalue
and everything is OK
however if I do
wf = WeeklyFixture(6) # where 6 is an id in the table so the wf is
wf.football_fixtures.name = “value”
I get a return value of true, but no data is written to the database.
I have the log visible on another terminal (tail -f development.log),
and I don’t see any update call being made. (I do see selects being
made when I read the records)
I think I’m missing something fundamental here. I assumed that when I
updated the related fields and wrote the parent model the the DB then
the save would also write the related fields, but this is not
BTW, if I do
that does work!
What (presumably simple) magic incantation am I missing?