Flowdock
method

ids_writer

Importance_1
v3.1.0 - Show latest stable - 1 note - Class: CollectionAssociation
ids_writer(ids) public

Implements the ids writer method, e.g. foo.item_ids= for Foo.has_many :items

Show source
Register or log in to add new notes.
September 17, 2011
0 thanks

this works, but doesn't make sense

does it?

replace(klass.find(ids).index_by { |r| r.id }.values_at(*ids))

equals

replace(klass.find(ids))

I see no point in making it that complicated