Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4390

Custom value in relation

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 12_01_17
    • Affects Version/s: 6.0.0, 6.0.2
    • Component/s: 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 Unassigned
            Reporter:
            marcostoribio10 Marcos Toribio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: