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

NoMethodError: undefined method `substitute' for XXX

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 5.0.2
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      sorry, my english is pool,
      development envirmonment is: ruby 2.2, rails 4.2, mongoid 4.0.2

      Models are:

      class Book
      include Mongoid::Document
      has_one :isdn
      end

      class Isdn
      include Mongoid::Document
      belongs_to :book
      end

      run below codes be throw error:
      book = Book.new
      isdn = Isdn.new

      book.isdn = isdn
      isdn.book = book

      book.isdn = isdn

      throw errror:
      NoMethodError: undefined method {{substitute' for #<Isdn:0x00000005f78fc8> from /home/ben/.rvm/gems/ruby-2.2.0/gems/mongoid-4.0.2/lib/mongoid/relations/accessors.rb:231:in }}block (2 levels) in setter'

            Assignee:
            emily.stolfo Emily Stolfo
            Reporter:
            ben-white ben-white
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: