Guest User

Untitled

a guest
May 27th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. class Node < ActiveRecord::Base
  2. has_many :counters, :dependent => :delete_all
  3. has_many :counter_types, :through => :counters, :uniq => true
  4. has_many :arena_modules
  5. has_many :arena_module_types, :through => :arena_modules, :uniq => true
  6. has_many :node_types, :through => :arena_module_types
  7. has_many :triggers
  8. belongs_to :product
  9. end
  10.  
  11. class ArenaModule < ActiveRecord::Base
  12.  
  13. belongs_to :node
  14. belongs_to :arena_module_type
  15. end
  16.  
  17. class ArenaModuleType < ActiveRecord::Base
  18.  
  19. has_many :arena_modules, :dependent => :delete_all
  20. has_many :nodes, :through => :arena_modules, :uniq => true
  21. has_and_belongs_to_many :node_types
  22. end
  23.  
  24. class NodeType < ActiveRecord::Base
  25.  
  26. has_and_belongs_to_many :arena_module_types
  27. has_many :nodes, :through => :arena_module_types
  28. end
Add Comment
Please, Sign In to add comment