# Removing an association from a derived class

**URL:** <https://www.ruby-forum.com/t/removing-an-association-from-a-derived-class/158894>\
**Category:** Rails\
**Created:** [January 29, 2009, 5:42am UTC](https://www.ruby-forum.com/t/removing-an-association-from-a-derived-class/158894 "2009-01-29T05:42:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Post date:** [January 29, 2009, 5:42am UTC](https://www.ruby-forum.com/t/removing-an-association-from-a-derived-class/158894/1 "2009-01-29T05:42:35Z")

</div>

I am using single table inheritance.

class User \< ActiveRecord::Base  
has\_many :abc  
end

class Student \< User

end

The student class should not inherit the has\_many :abc relationship.  
How can we override it? Is there a way to remove an association in the  
derived class?

Pankaj

---

<div class="post-metadata">

**Author:** ![pankaj](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@pankaj](https://www.ruby-forum.com/u/pankaj)\
**Post date:** [January 29, 2009, 5:49pm UTC](https://www.ruby-forum.com/t/removing-an-association-from-a-derived-class/158894/2 "2009-01-29T17:49:18Z")

</div>

Hi Pankaj,

has\_many creates quite a few other methods and you could remove them  
all but  
the usual and easiest way is to ignore and not to use them.  
Or, of course, change the design of your models.

ciao, tom
