disposable icon indicating copy to clipboard operation
disposable copied to clipboard

Support sequel association attributes

Open fran-worley opened this issue 8 years ago • 3 comments

Sequel by design does not save entire object graphs. Its association modification methods are designed to be very direct and not offer a lot of abstraction.

Rather than creating the records inline, we need to support creating the associated objects and then adding them to the parent.

Another option would be to make use of the nested attributes plugin but that might be even messier...

fran-worley avatar Sep 26 '17 21:09 fran-worley

I actually had a loooong chat with @solnic a few days ago and the plan is to get rid of Disposable and use ROM instead for domain-to-persistence operations. Cool? That could also be done step-wise by not relying on AR's crazy API but to base Disposable on Sequel's API and then add AR.

apotonick avatar Sep 27 '17 09:09 apotonick

That sounds awesome but how would that work for people that by choice (or not!) are using AR or Sequel?

Given our mutual feelings on AR it makes more sense to me to do as you say and base disposable on a supported ORM and add AR in as an option.

fran-worley avatar Sep 27 '17 09:09 fran-worley

You could come up with a common API and have adapters that implement it to support specific persistence libraries (AR, Sequel, rom-rb).

solnic avatar Sep 27 '17 09:09 solnic