Skip to content

Instantly share code, notes, and snippets.

@alexshagov
Last active May 10, 2016 17:11
Show Gist options
  • Save alexshagov/802b2617880139b4dc60e81b9cd62fc3 to your computer and use it in GitHub Desktop.
Save alexshagov/802b2617880139b4dc60e81b9cd62fc3 to your computer and use it in GitHub Desktop.
blog 2-3
class Post < ActiveRecord::Base
has_and_belongs_to_many :tags
end
class Tag < ActiveRecord::Base
has_and_belongs_to_many :posts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment