id extraction conversion fails for a custom-named belongs_to

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • 12_01_17
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I have:

      belongs_to :current_trip, class_name: 'Trip', inverse_of: nil, autosave: false
      

      Then,

      update_attribute(:current_trip, trip)
      

      generates

      update={"$set"=>{"current_trip_id"=>#<Trip _id: 50....
      

      and raises a {{NoMethodError (undefined method }}bson_dump' for #<Trip:0x007fd64a995fe8>)`
      whereas

      update_attribute(:current_trip, trip.id)
      

      works fine and generates

      update={"$set"=>{"current_trip_id"=>"50f....
      

            Assignee:
            Unassigned
            Reporter:
            Eugene Mirkin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: