class DatastaxRails::Types::DynamicMap
A collection type that allows you to store key/value pairs in Cassandra. Changes are tracked by hooking into ActiveModel's built-in change tracking.
Keys are converted to have the name of the collection prefixed to them as this is how the Solr/Cassandra integration converts between them and dynamic fields.
Public Instance Methods
[](key)
click to toggle source
Calls superclass method
# File lib/datastax_rails/types/dynamic_map.rb, line 19 def [](key) super(convert_key(key)) end
convert_key(key)
click to toggle source
Calls superclass method
# File lib/datastax_rails/types/dynamic_map.rb, line 23 def convert_key(key) key = name + key.to_s unless key.to_s.starts_with?(name) super(key) end
dup()
click to toggle source
# File lib/datastax_rails/types/dynamic_map.rb, line 13 def dup self.class.new(record, name, self).tap do |new_hash| new_hash.default = default end end