I also figured if I broke the ''location'' down into different
city/
state/country tables, then I could do something like:
@users = User.find(:all, :conditions => [''state_id = ?'',
State.find_by_name("IL").id[)
vs.
@users = User.find(:all, :include => :locations, :conditions =>
[''state_name = "IL"''])
--is this right?
On Nov 27, 5:41 am, quigebo
<quigebo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hey,
>
> I was wondering how I should create my database. I am going to have a
> ''location'' model, which has Address, State, Zip, Lat,
Lng, Country and
> vaguely remember from one class a long time ago that each table should
> have information that is specific to the table itself. So should I
> just create one locations table that has all of that information or
> should I break it down into a State, City, Country, Zip (both lat/
> lng), and Location (street address) tables? Thanks
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---