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

NoMethodError: undefined method `substitute' for XXX

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.0.2
    • Component/s: None
    • Labels:
      None

      Description

      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'

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: