Just a strange little one I came across this afternoon, I’d much
appreciate any thoughts any of you might have on it…
I was just implementing a small AJAX list sorter on a project, however
when I passed the “sortable_list” array and loop through it the .update
method seems to ignore associations on the object, and therefore they
Here’s the scenario:
A Sport (model) has_and_belongs_to_many Locales and Groups. Standard
HABTM association. The association data is present and working.
However the following is generated from a Sport.update(2, :position =>
3) call in the console:
#<Sport id: 2, created_at: “2008-03-14 12:50:23”, updated_at:
“2008-03-26 19:33:37”, name: "Rugby, position: 3>
Is this intentional that the associations are not included, and hence
I’ve made a dirty hack to make this work, it’s a bit fugly, but I’m
confused as to why I was getting the behaviour with .update above? Can
anyone shed some light?