recursively_embeds_many没有持久化

时间:2016-02-19 18:12:27

标签: mongoid

我有一个非常简单的模型

$dompdf->render();
$canvas = $dompdf->getCanvas();
$canvas->page_script('
  if ($PAGE_NUM > 1) {
    $font = $fontMetrics->getFont("helvetica", "bold");
    $current_page = $PAGE_NUM-1;
    $total_pages = $PAGE_COUNT-1;
    $pdf->text(522, 770, "Page: $current_page of $total_pages", $font, 10, array(0,0,0));
  }
');

我可以分配父母,但它似乎有效,但保存后数据不会保留。

class Region
  include Mongoid::Document
  recursively_embeds_many

  field :name, type: String
end

我做错了什么?

0 个答案:

没有答案