To populate from a static array or from AR.... I had the same quandry and
ended up doing it the 'rails' way as you describe below. Although as you
said, it is such a static thing that might as well use a constant array. The
other question is to store M/F in Person.gender or store an integer.

Since rails should be caching the model, I dont think it is a real big
difference performance-wise either way. I think it probably comes down to
your aesthetics, what feels right and what looks best to you.

On Thu, Jul 29, 2010 at 12:25 PM, bingo bob <[email protected]> wrote:

> 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/.
>
> --
> 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 [email protected].
> To unsubscribe from this group, send email to
> [email protected]<rubyonrails-talk%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/rubyonrails-talk?hl=en.
>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to