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

ArgumentError: wrong number of arguments (2 for 1) incrementable.rb:23:in `inc'

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

      I am using mongoid (4.0.0)

      I have a modal and here the code in my model

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      class Contact
        include Mongoid::Document
        include Mongoid::Timestamps
        include Mongoid::Paperclip
        include Mongoid::History::Trackable
        include ActiveSupport::Callbacks
        include ActiveModel::MassAssignmentSecurity
      
        field :first_name, type: String
        field :middle_name, type: String
        field :last_name, type: String
        field :picture_url, type: String
      
      end
      

      `

      When I start console and run bellow code I receive an error as ArgumentError: wrong number of arguments (2 for 1) But save function works fine. It saved the data. But error throws.

      Unable to find source-code formatter for language: `. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      c = Contact.last
      c.first_name = "Selva"
      c.save
      
      ArgumentError: wrong number of arguments (2 for 1)
      from /home/loginadmin/.rvm/gems/ruby-2.2.0/gems/mongoid-4.0.0/lib/mongoid/persistable/incrementable.rb:23:in `inc'
      

      `

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

              Created:
              Updated:
              Resolved: