diff --git a/app/assets/javascripts/admin/models/admin_user.js b/app/assets/javascripts/admin/models/admin_user.js index d9c2c8e475f..713f32d0abe 100644 --- a/app/assets/javascripts/admin/models/admin_user.js +++ b/app/assets/javascripts/admin/models/admin_user.js @@ -62,9 +62,10 @@ Discourse.AdminUser = Discourse.User.extend({ return this.get('username').toLowerCase(); }).property('username'), - trustLevel: (function() { - return Discourse.get('site.trust_levels').findProperty('id', this.get('trust_level')); - }).property('trust_level'), + trustLevel: function() { + var site = Discourse.Site.instance(); + return site.get('trust_levels').findProperty('id', this.get('trust_level')); + }.property('trust_level'), isBanned: (function() { return this.get('is_banned') === true; diff --git a/app/assets/javascripts/discourse/models/site.js b/app/assets/javascripts/discourse/models/site.js index 7b497b65f9e..8f6e987599c 100644 --- a/app/assets/javascripts/discourse/models/site.js +++ b/app/assets/javascripts/discourse/models/site.js @@ -38,7 +38,7 @@ Discourse.Site = Discourse.Model.extend({ Discourse.Site.reopenClass({ - find: function() { + instance: function() { return Discourse.Site.create(PreloadStore.get('site')); }, diff --git a/app/assets/javascripts/discourse/routes/application_route.js b/app/assets/javascripts/discourse/routes/application_route.js index 6e3c93831a9..19c986af410 100644 --- a/app/assets/javascripts/discourse/routes/application_route.js +++ b/app/assets/javascripts/discourse/routes/application_route.js @@ -8,7 +8,7 @@ **/ Discourse.ApplicationRoute = Discourse.Route.extend({ setupController: function(controller) { - Discourse.set('site', Discourse.Site.find()); + Discourse.set('site', Discourse.Site.instance()); var currentUser = PreloadStore.get('currentUser'); if (currentUser) { diff --git a/app/assets/javascripts/discourse/routes/list_category_route.js b/app/assets/javascripts/discourse/routes/list_category_route.js index 24f4656cf4e..c2127df8653 100644 --- a/app/assets/javascripts/discourse/routes/list_category_route.js +++ b/app/assets/javascripts/discourse/routes/list_category_route.js @@ -9,11 +9,11 @@ Discourse.ListCategoryRoute = Discourse.FilteredListRoute.extend({ model: function(params) { - var categories = Discourse.Site.find().get('categories'); + var categories = Discourse.Site.instance().get('categories'); var slug = Em.get(params, 'slug'); - category = categories.findProperty('slug', Em.get(params, 'slug')) + var category = categories.findProperty('slug', Em.get(params, 'slug')) // In case the slug didn't work, try to find it by id instead. if (!category) {