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

undefined method `to_i' for BSON::ObjectId

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

      I have an issue with my create controller:

      def create
      @model = Model.new(params[:model])
      if model.save
      redirect_to show_model_path(@model), :notice => "Successfully created model."
      end
      end

      I am able to create a new record, but when it checks for the save (line 3 of create), I am given the following error:

      NoMethodError (undefined method `to_i' for BSON::ObjectId('4da45316399c46cda0000003'):BSON::ObjectId):

      Any help would be much appreciated!

      D.

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

              Created:
              Updated:
              Resolved: