Hi,

So far I've let Rails and ActiveRecord rule the game. But I think
there's some things I should change.

I have a record (called Tag) that is searched by using the default auto
incrementable Id that AR provides. On the Tag record I also keep a
unique identifier which is a string of 13 characters. That identifier is
really the Tag.

So my doubts are:
- Should I set the custom identifier as the primary key and remove the
default id?
- Or should I keep the default Id but instead fill it with the custom
identifier?
- Would it make any difference when thinking of performance?

I'm currently adding some statistics record for each of those Tags. So
one tag "has_many" statistic records. And this statistics record has the
Tag identifier stored. That's when I thought that the common key to tie
them together should be the custom identifier instead of the default id.

Any opinions? I hope I managed to explain my doubts.

Cheers.

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

Reply via email to