daily pastebin goal
28%
SHARE
TWEET

Untitled

a guest Jan 14th, 2018 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Country
  2.   include Mongoid::Document
  3.  
  4.   field :code, type:String
  5.   field :title, type:String
  6.   embeds_many :categories
  7.  
  8. end
  9.  
  10.  
  11. class Category
  12.   include Mongoid::Document
  13.  
  14.   field :title
  15.   embedded_in :country, inverse_of:  :categories
  16.   embeds_many :category_items
  17. end
  18.  
  19. class CategoryItem
  20.   include Mongoid::Document
  21.    
  22.   field :title, type:String
  23.   field :pubdate, type:String
  24.   field :image_name, type:String
  25.   field :image_url, type:String
  26.   field :keywords, type:String
  27.  
  28.   embedded_in :categories, inverse_of:  :category_items
  29. 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