Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Country
- include Mongoid::Document
- field :code, type:String
- field :title, type:String
- embeds_many :categories
- end
- class Category
- include Mongoid::Document
- field :title
- embedded_in :country, inverse_of: :categories
- embeds_many :category_items
- end
- class CategoryItem
- include Mongoid::Document
- field :title, type:String
- field :pubdate, type:String
- field :image_name, type:String
- field :image_url, type:String
- field :keywords, type:String
- embedded_in :categories, inverse_of: :category_items
- end
Add Comment
Please, Sign In to add comment