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

Issues with ruby 2.2.0

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 12_01_17
    • Component/s: None
    • Labels:
      None

      Description

      I tried to update my app to ruby 2.2.0 and it seems the Timestamps has an issue but i'm not sure how right now.

      I get this error when a new model is saved:

      Mongoid::Errors::UnknownAttribute: 
      Problem: Attempted to set a value for 'updated_at' which is not allowed on the model 
      ParsedItem.Summary: Without including Mongoid::Attributes::Dynamic in your model and the attribute 
      does not already exist in the attributes hash, attempting to call ParsedItem#updated_at= for it is not 
      allowed. This is also triggered by passing the attribute to any method that accepts an attributes hash, and 
      is raised instead of getting a NoMethodError.Resolution: You can include Mongoid::Attributes::Dynamic if 
      you expect to be writing values for undefined fields often.
      

      So when it's trying to save the updated_at field i get that it does not exist.

      Also after i removed the timestamps it gave me the same issue with a regular field called desc...

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: