kernow (owner)

Revisions

gist: 224163 Download_button fork
public
Public Clone URL: git://gist.github.com/224163.git
Embed All Files: show embed
Text only #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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