# What is this code add\_to\_serializer in all these plugins

**URL:** <https://meta.discourse.org/t/what-is-this-code-add-to-serializer-in-all-these-plugins/58913>\
**Category:** Development\
**Created:** [March 12, 2017, 5:07am UTC](https://meta.discourse.org/t/what-is-this-code-add-to-serializer-in-all-these-plugins/58913 "2017-03-12T05:07:15Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![joebuhlig](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/joebuhlig/32/193054_2.png) [@joebuhlig](https://meta.discourse.org/u/joebuhlig)\
**Post date:** [March 15, 2017, 4:36pm UTC](https://meta.discourse.org/t/what-is-this-code-add-to-serializer-in-all-these-plugins/58913/5 "2017-03-15T16:36:25Z")

</div>

Add this directly above your code `require_dependency 'topic_serializer'`

```ruby
require_dependency 'topic_serializer'
class ::TopicSerializer
  attributes :flag_name
  def flag_name
    object.flag_name
  end
end

```

---

_[View the full topic](https://meta.discourse.org/t/what-is-this-code-add-to-serializer-in-all-these-plugins/58913)._
