Created
November 2, 2009 13:42
-
-
Save kernow/224163 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateGenresShows < ActiveRecord::Migration | |
def self.up | |
create_table :genres_shows, :id => false do |t| | |
t.integer :show_id | |
t.integer :genre_id | |
end | |
end | |
def self.down | |
drop_table :shows_genres | |
end | |
end | |
class Show < ActiveRecord::Base | |
has_and_belongs_to_many :genres | |
end | |
class Genre < ActiveRecord::Base | |
has_and_belongs_to_many :shows | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment