I just have a few questions about join tables. From my understanding
the following applies (correct me if I'm wrong):
1.Join tables are always named with the names of the two associated
tables, in alphabetical order, separated by an underscore.
2.The foreign key fields are named with the name of the table they are
referencing, with _id appended.
3.The foreign key is referencing a single element in that table, so it
uses the singular name.
However, I've installed both of the following plugins:
redhillonrails_core
foreign_key_migrations
So, as an example, let's say I created 32 tables with the following type
of information:
def self.up
create_table :rushing_offenses do |t|
t.integer :team_id
t.string :name
t.integer :games
t.integer :carries
t.integer :net
t.float :avg
t.integer :tds
t.float :ydspg
t.timestamps
end
end
And I want to create a join table for the team_id to associate with all
those tables:
How would I define the self.up for the join table? Is the naming
convention necessary per above?
--
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]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---