fix class methods for indexing inside AR