<commit_before>import AbstractIndexRoute from 'hospitalrun/routes/abstract-index-route';
import UserSession from "hospitalrun/mixins/user-session";
export default AbstractIndexRoute.extend(UserSession, {
    modelName: 'inventory',
    newButtonAction: function() {
        if (this.currentUserCan('add_inventory_item')) {
            return 'newItem';
        } else {
            return null;
        }
    }.property(),    
    newButtonText: '+ new item',
    pageTitle: 'Items',
    
    _modelQueryParams: function() {
        return {
            mapReduce: 'inventory_by_name'
        };
    },
    
    _getStartKeyFromItem: function(item) {
        return [item.get('name'),'inventory_'+item.get('id')];
    }
        
});<commit_msg>Fixed paging on inventory listing<commit_after>import AbstractIndexRoute from 'hospitalrun/routes/abstract-index-route';
import Ember from 'ember';
import UserSession from 'hospitalrun/mixins/user-session';
export default AbstractIndexRoute.extend(UserSession, {
    pouchdb: Ember.inject.service(),
    modelName: 'inventory',
    newButtonAction: function() {
        if (this.currentUserCan('add_inventory_item')) {
            return 'newItem';
        } else {
            return null;
        }
    }.property(),    
    newButtonText: '+ new item',
    pageTitle: 'Items',
    
    _modelQueryParams: function() {
        return {
            mapReduce: 'inventory_by_name'
        };
    },
    
    _getStartKeyFromItem: function(item) {
        var inventoryId = this.get('pouchdb').getPouchId(item.get('id'), 'inventory');
        return [item.get('name'),inventoryId];
    }
        
});
{'fraction_non_alphanumeric': 0.12598904443091904, 'fraction_numerical': 0.0, 'mean_word_length': 2.7194570135746607, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5370589', 'n_tokens_mistral': 486, 'n_tokens_neox': 479, 'n_words': 88}