Custom value in relation

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Minor - P4
    • 12_01_17
    • Affects Version/s: 6.0.0, 6.0.2
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Hi,
      I want to set a relation without _id reference.
      I want to save, for example the key in the related document.

      class Brand
      include Mongoid::Document

      field :name, type: String
      field :key, type: Symbol

      has_many :products
      end
      class Product
      include Mongoid::Document

      field :name, type: String
      field :key, type: Symbol

      belongs_to :marca
      end

      ProductDocument

      Unknown macro: { _id}

      For me is not important the key of the relation, only value.

      Thanks.

              Assignee:
              Unassigned
              Reporter:
              Marcos Toribio
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: