lib/doeskeyvalue/indexes.rb in doeskeyvalue-0.1.3 vs lib/doeskeyvalue/indexes.rb in doeskeyvalue-0.2.0
- old
+ new
@@ -91,10 +91,14 @@
index_table_name = "key_value_index"
num_del = ActiveRecord::Base.connection.delete("DELETE FROM `#{index_table_name}` WHERE `obj_type` = \"#{self.class}\" AND `obj_id` = #{self.id}")
end
after_destroy "update_index_#{key_value_column}_#{key_name}_after_destroy"
+
+ # Add the index to the key and column manager:
+ DoesKeyValue::KeyManager.instance.declare_index(self, key_value_column, key_name, opts)
+
end
- end # Index
+ end # Indexes
end # DoesKeyValue
\ No newline at end of file