에 의해 발견 나는 다음과 같은 임베디드 구조를 가지고는 Mongoid가 포함 된 문서
class CbAuthor
include Mongoid::Document
embeds_many: cb_bylines
field :name, type: String
end
class CbByline
include Mongoid::Document
embedded_in :cb_author
has_many :cb_articles
field :byline, type: String
end
class CbArticle
include Mongoid::Document
belongs_to :cb_byline
end
이 많은 회 선별 또는 가명 저자 아래에 게시하고 자신의 분석 보고서에 첨부됩니다되어이 있기 때문이다. 그래서 필자가 회선을 가지고있을 때 저자를 어떻게 찾습니까? 이것은 모든 대대적 인 회선 아래에 작성한 모든 기사를 나열해야하는 대시 보드를 갖기 때문에 필요합니다.
나는 CbAuthor.cb_bylines
을 시도했지만 아무런 방법 오류가 발생하지 않습니다. 또는 CbAuthor.where(cb_bylines["byline"]: bylineInQuestion)
하지만 오류가 있습니다.
는 본질적 목표는 최소한으로 (그 회 선별