lib/acts_as.rb in acts_as-0.1.1 vs lib/acts_as.rb in acts_as-0.2.0
- old
+ new
@@ -8,9 +8,16 @@
def self.included(base)
raise ActiveRecordOnly unless base < ActiveRecord::Base
base.extend ClassMethods
end
+ def previous_changes
+ self.class.acts_as_fields.keys.map{ |association| send(association).previous_changes }
+ .reduce(super) do |current, association_changes|
+ current.merge(association_changes)
+ end
+ end
+
private
def acts_as_field_match?(method)
@association_match = self.class.acts_as_fields.select do |association, fields|
fields.select { |f| method.to_s.include?(f) }.any?