Open mtpersonalfile opened 11 years ago
+1
+1
I managed it with reopening translation class inside my model:
class Mymodel < ApplicationRecord
# translation
translates :first_name, :last_name
# audit - audit base table
audited
# ADD THIS to audit translation
Translation.class_eval do
audited
end
see full example here: https://gist.github.com/maxivak/e1c6b39b9ec5a16d2d3daacbdd2a64d4
Trying to audit fields that are translated with globalize, with no success. I can audit all fields in table Persons, and all associated models, like contacts and notes, but don't know how to include translation tables (preson_translatios). Any suggestions or help please. Thanx
Example:
class Person < ActiveRecord::Base translates :first_name, :last_name accepts_nested_attributes_for :translations
has_many :contacts, as: :contactable, dependent: :destroy has_many :notes, as: :notable, dependent: :destroy
audited :allow_mass_assignment => true has_associated_audits