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

fix bug in versioning.rb

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

      Update:

      now both unit/mongoid/versioning_spec.rb and integration/mongoid/versioning_spec.rb should pass.

      When I use
      include Mongoid::Versioning
      max_versions 1
      in my project, I found the model keep saving old copies dicarding the existence of max_versions.

      I think the problem occurs because
      self.versions.shift
      won't actually change the underlying object.

      I wrote a patch that fix the problem and add an option to specify max_versions 0 which only update version numbers without actually saving old copies.

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

              Created:
              Updated:
              Resolved: