Merge pull request #813 from opf/fix/journaled_attribute_selection

Changed acts_as_journalized to only use the journalized attributes
pull/821/head
Philipp Tessenow 11 years ago
commit dee6a2c663
  1. 4
      app/models/journal/base_journal.rb
  2. 2
      lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/creation.rb

@ -36,12 +36,12 @@ class Journal::BaseJournal < ActiveRecord::Base
attributes.symbolize_keys.select{|k,_| self.class.journaled_attributes.include? k}
end
private
def self.journaled_attributes
@journaled_attributes ||= column_names.map{ |n| n.to_sym} - excluded_attributes
end
private
def self.column_names
db_columns(table_name).map(&:name)
end

@ -104,7 +104,7 @@ module Redmine::Acts::Journalized
initial_changes = {}
self.attributes.keys.reject{|attribute| self.class.vestal_journals_options[:except].include?(attribute)}.each do |name|
JournalManager.journal_class(self.class).journaled_attributes.each do |name|
# Set the current attributes as initial attributes
# This works as a fallback if no prior change is found

Loading…
Cancel
Save