# مشكلة في الوصول إلى التفضيلات بعد الترقية إلى Discourse 2.1.0.beta4

**URL:** <https://meta.discourse.org/t/trouble-accessing-preferences-after-upgrade-to-discourse-2-1-0-beta4/94253>\
**Category:** Bug\
**Created:** [8 أغسطس 2018، 10:18م UTC](https://meta.discourse.org/t/trouble-accessing-preferences-after-upgrade-to-discourse-2-1-0-beta4/94253 "2018-08-08T22:18:17Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![xrav3nz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/xrav3nz/32/76894_2.png) [@xrav3nz](https://meta.discourse.org/u/xrav3nz)\
**Post date:** [11 أغسطس 2018، 3:02ص UTC](https://meta.discourse.org/t/trouble-accessing-preferences-after-upgrade-to-discourse-2-1-0-beta4/94253/2 "2018-08-11T03:02:33Z")

</div>

> [@pfaffman](#):
>
> `db=5577.50 ... db_calls=111`

Now that’s a lot of queries …

Reproduced and checked locally, `UserSerializer` is making tons of SQL queries on the fly when serializing `user_badge.granted_by`.

I think `UserSerializer` is an overkill for the badges page, and `BasicUserSerializer` should do?

```diff
 class DetailedUserBadgeSerializer < BasicUserBadgeSerializer
- has_one :granted_by
+ has_one :granted_by, serializer: BasicUserSerializer

```

This cut down the number of queries from 81 to 8 locally for me.

Not too familiar with the badge-related pages, will dig a bit deeper to make sure this has no other side effects before submitting a PR.

---

_[View the full topic](https://meta.discourse.org/t/trouble-accessing-preferences-after-upgrade-to-discourse-2-1-0-beta4/94253)._
