Guest User

Untitled

a guest
Jul 19th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. class WallMessage < ActiveRecord::Base
  2. belongs_to :account
  3.  
  4. has_many :wall_comments, :dependent => :destroy
  5. has_many :comments, :through => :wall_comments
  6. end
  7.  
  8. class WallComment < ActiveRecord::Base
  9. belongs_to :wall_message
  10. belongs_to :comment, :class_name => "WallMessage", :foreign_key => "comment_id"
  11. end
Add Comment
Please, Sign In to add comment