class DatastaxRails::WideStorageModel

A special model that is designed to efficiently store very wide data. This model type assumes that you have a unique ID that you want to store a lot of data about. The data is stored as a single, very wide row; however you can safely treat it as if there were multiple rows. A common example of this is a logs table

You can also apply secondary indexes onto the other columns.

CAVEATS:

Public Instance Methods

id_for_update() click to toggle source

Returns a primary key hash for updates that includes the cluster key

# File lib/datastax_rails/wide_storage_model.rb, line 29
def id_for_update
  cc = self.class.column_for_attribute(self.class.cluster_by)
  { self.class.primary_key.to_s => __id,
    self.class.cluster_by.to_s  => cc.type_cast_for_cql3(read_attribute(self.class.cluster_by.to_s)) }
end