Advertisement
Guest User

article.rb

a guest
Jun 28th, 2019
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rails 0.29 KB | None | 0 0
  1. class Article < ActiveRecord::Base
  2.     has_many :comments
  3.     has_many :taggings
  4.     has_many :tags, through: :taggings
  5.  
  6.     class Tag < ActiveRecord::Base
  7.  
  8.       has_many :taggings
  9.       has_many :articles, through: :taggings
  10.    
  11.       def to_s
  12.         name
  13.       end
  14.     end
  15.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement