Guest User

Untitled

a guest
Dec 15th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.68 KB | None | 0 0
  1. ###############strom cez 3 tabulky
  2. class Document < ActiveRecord::Base
  3.   has_many :sections
  4.   has_many :paragraphs, :through => :sections
  5. end
  6.  
  7. class Section < ActiveRecord::Base
  8.   belongs_to :document
  9.   has_many :paragraphs
  10. end
  11.  
  12. class Paragraph < ActiveRecord::Base
  13.   belongs_to :section
  14. end
  15.  
  16. ################strom cez 4 tabulky
  17. class Document < ActiveRecord::Base
  18.   has_many :sections
  19.   has_many :paragraphs, :through => :sections
  20. end
  21.  
  22. class Section < ActiveRecord::Base
  23.   belongs_to :document
  24.   has_many :paragraphs
  25. end
  26.  
  27. class Paragraph < ActiveRecord::Base
  28.   belongs_to :section
  29.   has_many :xyzs
  30. end
  31.  
  32. class Xyz < ActiveRecord::Base
  33.   belongs_to :paragraph
  34. end
Add Comment
Please, Sign In to add comment