9
10
11
12
13
14
15
16
17
|
# File 'lib/active_metadata/persistence/history.rb', line 9
def save_history
return if ActiveMetadata.skip_history?
self.changes.each do |key, value|
next if ActiveMetadata::CONFIG['history_skip_fields'].include?(key) || !change_is_valid_for_history?(value)
ActiveMetadata::History.create! :value => value[1],:model_class => metadata_class, :model_id => metadata_id,:label => key.to_s, :created_by => current_user_id
invalidate_history_cache_for key.to_s
self.send(:send_notification, key, value[0], value[1], :history_message, current_user_id) unless skip_history_notification?
end
end
|