我有索引頁中的student_names列表。如果我刪除一個學生,它會從Mongo數據庫中銷燬整個文檔。 但是,如果我從索引頁面中刪除它,它應該從列表中刪除,但不想從Mongo數據庫中刪除它。我不想從我的數據庫中銷燬任何數據! I know the other ways to achieve但我想知道在mongoid中我們需要包含一個額外的Mongoid模塊來支持它。他們的任何功能都可用於mong
我是MongoID的新手。我有以下型號: class Vehicle
include Mongoid::Document
include Mongoid::Timestamps
##
# Relationship
embeds_one :specification
end
class Specification
include M
我有以下代碼: 工廠/ web.rb FactoryGirl.define do
factory :web do
name 'Name of web'
url 'http://google.es'
after(:create) do |web|
10.times do |i|
web.link << FactoryGirl.crea
我使用的是mongoid 3,並發現以下問題: 可以說我們有一個用戶,他有很多帖子。 所以 class User
has_many :posts
class Post
field :name
belongs_to :user
忽略丟失mongoid ::文件。 我使用導軌,所以我得到了身份地圖。 可以說用戶想編輯他的一篇文章。 我想確保服務器端的帖子實際上屬於用