Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 1.66 KB

UPGRADING.md

File metadata and controls

53 lines (34 loc) · 1.66 KB

Upgrading Mongoid History

Upgrading to 0.8.0

History is now tracked on create and destroy by default

By default, Mongoid History will now track all actions (create, update, and destroy.) Previously, only update actions were tracked by default.

To preserve the old behavior, please modify your call to track_history as follows:

  track_history ...
                track_create: false,
                track_destroy: false

See #207 for more information.

Upgrading to 0.7.0

Remove history track when create, update or destroy raises an error

When an error is raised in a call to create, update or destroy a tracked model, any history track created before the call will now be deleted. In the past this was a problem for associations marked dependent: :restrict.

See #202 for more information.

Main Changes / Upgrading Notes

See #189 for more information.

  • Currently, the :all option behaves identically to :fields. Future versions will track all fields and relations of trackable class when using :all.

Upgrading to 0.4.1

Migrate Userstamp

Mongoid::History no longer supports the userstamp natively. To track the User in the application who created the HistoryTracker, add the Mongoid::Userstamp gem to your HistoryTracker class.

class MyHistoryTracker
  include Mongoid::History::Tracker
  include Mongoid::Userstamp
end

Rename the field.

MyHistoryTracker.all.rename(modifier_id: :created_by)