NoMethodError: undefined method `substitute' for XXX

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Major - P3
    • 5.0.2
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
            Reporter:
            ben-white
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: