Created
January 18, 2014 21:00
-
-
Save a2f0/8496381 to your computer and use it in GitHub Desktop.
This file contains 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
Migration: | |
class CreateJoinTableCommandTag < ActiveRecord::Migration | |
def change | |
create_join_table :commands, :tags do |t| | |
# t.index [:command_id, :tag_id] | |
# t.index [:tag_id, :command_id] | |
end | |
end | |
end | |
Model: | |
class CommandTag < ActiveRecord::Base | |
belongs_to :command | |
belongs_to :tag | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment