Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Answer
- include Mongoid::Document
- include Mongoid::Timestamps
- field :au # answerer
- field :uiq # user in question, current shard key
- field :qt # question template
- field :res, :type => Integer # answer code
- field :ncmt, :type => Integer # number of comments
- references_many :comments # comments are not embedded (but probably they should be)
- end
- class Comment
- include Mongoid::Document
- include Mongoid::Timestamps
- field :text
- field :is_new, :type => Integer, :default => 1
- referenced_in :answer
- field :vk_user # comment poster
- end
Add Comment
Please, Sign In to add comment