Method: Cequel::Record::List#unshift

Defined in:
lib/cequel/record/collection.rb

#unshift(*objects) ⇒ List Also known as: prepend

Prepend one or more values to the beginning of this list

Parameters:

  • objects

    value(s) to add to the beginning of the list

Returns:

Since:

  • 1.0.0



326
327
328
329
330
331
# File 'lib/cequel/record/collection.rb', line 326

def unshift(*objects)
  objects.map!(&method(:cast_element))
  prepared = @model.class.connection.bug8733_version? ? objects.reverse : objects
  to_update { updater.list_prepend(column_name, prepared) }
  to_modify { super }
end