Class: ActionMerge::Document::Chunk

Inherits:
ApplicationRecord show all
Defined in:
app/models/action_merge/document/chunk.rb

Instance Method Summary collapse

Instance Method Details

#upsert(k, v) ⇒ Object



5
6
7
8
9
# File 'app/models/action_merge/document/chunk.rb', line 5

def upsert(k,v)
c = chunks.find(k).presence || chunks.new(primary_key => k)
c.update!(v)
c.save
end