jeremyevans/sequel — Issue #423: Each add_xxx association call is an eager insert to db
Author: jingweno
Created: 2012-01-16 08:02:47+00:00
State: open

Hi,

I am wondering whether the add_xxx call the the association can be lazy. For example, the following code will break:

```ruby
class Album
many_to_one :artist
end
class Artist
one_to_many :albums
end

# works ok
@artist = Artist.create(:name=>'YJM')
@artist.add_album(@album)

# breaks since add_xxx is an eager insert
@artist = Artist.new(:name=>'YJM')
@artist.add_album(@album)
```