Keith,
On 22.4.2005, at 09:51, Keith Donaldson wrote:
> In order to update my join table that contained an attribute I had to
> first delete the association then push it back with the attribute.
> This seems like heavy handed way to update a join table with
> attributes. Here is the bit of code:
>
> @student.courses.delete(@course)
> @student.courses.push_with_attributes(@course, :narrative =>
> @params[''student''][''narrative''])
>
> Does this point to a poor model?
Dunno, there probably should be a update_with_attributes method. I
think the reason for its absence is that when people have started to
have a lot of own attributes in their join table, they have found it
easier to promote it to a model of its own. Therefore no one has had
enough will to create such a function. Of course it should be trivial
to clone push_with_attributes and make the relevant changes.
//jarkko
>
> Thanks,
>
> kd
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
Jarkko Laine
http://jlaine.net
http://odesign.fi
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails