This saving will always be required, because adding a new object to an
association should never have the side effect of actually saving the
Tagging object here too. That would be really unexpected imho.
For us, ActiveRecord is not the default standard on how things behave.
We like to create something that fits the Ruby idiom of behaving like
a developer expects. Saving objects as a side-effect of just adding it
to an association does not really fit that principle of least
surprise.
These things notwithstanding, the has :through code is not up to par,
so there probably will be issues. We're not yet sure on how to solve
all of these problems, so that will take some discussion too.
--
Regards,
Dirkjan Bussink
> BTW, I meant to mention - although I realize there's no fundamental
> reason to view ActiveRecord as the default standard, there has been
> some indication in the publicity for Datamapper that it's drop-in
> compatible. See slide 9 from Yehuda's talk at RailsConf:
> http://schulty.com/articles/datamapper_presented_at_railsconf08.html.
> This seems a little misleading.
Technically, that's not what it says. It says you can drop it into
Rails by 1.0 and use it there, not that it's an actual replacement for
ActiveRecord. Maybe the phrasing is open for questioning, but I'm
pretty sure this us is what Yehuda means to say.
On the many to many issue, there are quite a few parts in it's
behavior that haven't been thought through completely, so it's like
some behavior is going to change. The goal will always be to be clear
on what happens and be consistent with other behaviors in DM.
--
Regards,
Dirkjan Bussink