/*global Ember */

var trailingHistory = Ember.HistoryLocation.extend({
    setURL: function (path) {
        var state = this.getState();
        path = this.formatURL(path);
        path = path.replace(/\/?$/, '/');

        if (state && state.path !== path) {
            this.pushState(path);
        }
    }
});

var registerTrailingLocationHistory = {
    name: 'registerTrailingLocationHistory',

    initialize: function (container, application) {
        application.register('location:trailing-history', trailingHistory);
    }
};

export default registerTrailingLocationHistory;
/*global Ember */

var trailingHistory = Ember.HistoryLocation.extend({
    formatURL: function () {
        return this._super.apply(this, arguments).replace(/\/?$/, '/');
    }
});

var registerTrailingLocationHistory = {
    name: 'registerTrailingLocationHistory',

    initialize: function (container, application) {
        application.register('location:trailing-history', trailingHistory);
    }
};

export default registerTrailingLocationHistory;
Fix trailing slashes output app-wide
Fix trailing slashes output app-wide

closes #2963, closes #2964
- override Ember's `HistoryLocation.formatURL`
- remove overridden `HistoryLocation.setURL`
