SHARE
TWEET

article.rb

a guest Jun 28th, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top