# Re: how to deal with gender

**URL:** <https://www.ruby-forum.com/t/re-how-to-deal-with-gender/192416>\
**Category:** Rails\
**Created:** [July 29, 2010, 10:54pm UTC](https://www.ruby-forum.com/t/re-how-to-deal-with-gender/192416 "2010-07-29T22:54:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cesar\_Sanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/50afbb/32.png) [@Cesar\_Sanz](https://www.ruby-forum.com/u/Cesar_Sanz)\
**Post date:** [July 29, 2010, 10:54pm UTC](https://www.ruby-forum.com/t/re-how-to-deal-with-gender/192416/1 "2010-07-29T22:54:51Z")

</div>

I would use the gender attribute instead of creating a new entity in my  
model… But it depends on your model design

-original message-  
Subject: [Rails] how to deal with gender  
From: bingo bob [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Date: 07/29/2010 10:25

Appreciate this is a path well travelled probably.

What’s the best way of to deal with gender.

i.e. a Person is either Male or Female (generally and fot my purposes  
I’ll stick with that rule).

So is it best to go Person with an attribute gender, or, I guess it’s  
best to do something like this - the rails way?

Person  
belongs\_to: gender

Gender  
has\_many: people

## Sorry if this is such an obvious question just want to do it right.

Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

–  
You received this message because you are subscribed to the Google  
Groups “Ruby on Rails: Talk” group.  
To post to this group, send email to removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
