lib/zermelo/associations/unique_index.rb in zermelo-1.0.1 vs lib/zermelo/associations/unique_index.rb in zermelo-1.1.0
- old
+ new
@@ -7,11 +7,10 @@
def initialize(parent_klass, name)
@parent_klass = parent_klass
@attribute_name = name
@backend = parent_klass.send(:backend)
- @class_key = parent_klass.send(:class_key)
@indexers = {}
parent_klass.send(:with_index_data, name.to_sym) do |data|
@attribute_type = data.type
@@ -30,10 +29,10 @@
@backend.move(key, {@backend.index_keys(@attribute_type, value_to).join(':') => id}, indexer_to.key)
end
def key
@indexer ||= Zermelo::Records::Key.new(
- :klass => @class_key,
+ :klass => @parent_klass,
:name => "by_#{@attribute_name}",
:type => :hash,
:object => :index
)
end
\ No newline at end of file