# How to make a private attributes in STI?

**URL:** <https://www.ruby-forum.com/t/how-to-make-a-private-attributes-in-sti/151785>\
**Category:** Rails\
**Created:** [October 25, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/how-to-make-a-private-attributes-in-sti/151785 "2008-10-25T17:50:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [October 25, 2008, 5:50pm UTC](https://www.ruby-forum.com/t/how-to-make-a-private-attributes-in-sti/151785/1 "2008-10-25T17:50:43Z")

</div>

people table like this

id int not null auto\_increment,  
type varchar not null  
/\* common attributes \*/

name varchar not null,  
email varchar not null,  
/\* attributes for type=Customer \*/

balance decimal(10,2),  
/\* attributes for type=Employee \*/

## ================= model

class person \< activerecord::Base  
end

class Customer \< Person  
end

class Employee \< Person  
end

============  
this is a segnment on ‘agile web development with rails’

my silly question is though the autoer note which attribute belong who,  
but in the real world, real code, how can I know which is private  
attribute for customer or employee?

---

<div class="post-metadata">

**Author:** ![rubyernewbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9dc877/32.png) [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Post date:** [October 26, 2008, 3:42am UTC](https://www.ruby-forum.com/t/how-to-make-a-private-attributes-in-sti/151785/2 "2008-10-26T03:42:25Z")

</div>

> my silly question is though the autoer note which attribute belong who,  
> but in the real world, real code, how can I know which is private  
> attribute for customer or employee?

any thought here?
