Skip to content

Nested attributes not getting tracked #138

Open
@adityashankert

Description

@adityashankert

Hi I have a scenario in that i have updated the embedded_document using nested attributes but it is not getting tracked but the changes in the outer document are getting tracked can I know how to get that working?
the following is the tracking_history initialization in the models

#invoice.rb

class Invoice
    include Mongoid::Document
    include Mongoid::Attributes::Dynamic
    include Mongoid::Timestamps
    include Mongoid::History::Trackable


    embeds_many :invoice_details
    accepts_nested_attributes_for :invoice_details

  track_history :on => :all
end 

#invoice_detail.rb
class InvoiceDetail
    include Mongoid::Document
    include Mongoid::Attributes::Dynamic
    include Mongoid::Timestamps
  include Mongoid::History::Trackable
  embedded_in :invoice

  track_history     :on=> :all,
                    :scope => :invoice,
                    :track_create => true,
                    :track_destroy => true
end

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions