# Why does calling super in PostSerializer#raw cause a 500 error while calling object.raw works?

**URL:** https://meta.discourse.org/t/why-does-calling-super-in-postserializer-raw-cause-a-500-error-while-calling-object-raw-works/390455
**Category:** Development
**Created:** [December 4, 2025, 9:24pm UTC](https://meta.discourse.org/t/why-does-calling-super-in-postserializer-raw-cause-a-500-error-while-calling-object-raw-works/390455 "2025-12-04T21:24:41Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![pangbo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pangbo/32/538562_2.png) [@pangbo](https://meta.discourse.org/u/pangbo)
#### Post date: [December 5, 2025, 2:41pm UTC](https://meta.discourse.org/t/why-does-calling-super-in-postserializer-raw-cause-a-500-error-while-calling-object-raw-works/390455/3 "2025-12-05T14:41:23Z")

</div>

This is a feature of Ruby. When you use `class ::PostSerializer`, you are **overriding** the definition in the original class instead of inheriting from it. Because you are not inheriting from `PostSerializer`, `super` cannot find the corresponding method.

You should use `prepend` instead of reopening an already defined class.

---

_[View the full topic](https://meta.discourse.org/t/why-does-calling-super-in-postserializer-raw-cause-a-500-error-while-calling-object-raw-works/390455)._
