Skip to content

Commit

Permalink
You can now ignore fields with the :exclude option-- it should take a…
Browse files Browse the repository at this point in the history
… single value or an array.
  • Loading branch information
bigfleet committed Feb 24, 2010
1 parent f89aa7b commit d239dbe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/trackable/event.rb
Expand Up @@ -3,6 +3,7 @@ class Event < ActiveRecord::Base
def self.attributes_from(model, key, old_val, new_val)
return if old_val.blank? && new_val.blank? #not something we need to track.
eventable_options = model.class.eventable_options
return if [eventable_options[:exclude]].flatten.include?(key.to_sym)
msg = if eventable_options[:events][key.to_sym] && eventable_options[:events][key.to_sym][new_val]
eventable_options[:events][key.to_sym][new_val]
elsif eventable_options[:events][key.to_sym] && eventable_options[:events][key.to_sym][:message]
Expand Down

0 comments on commit d239dbe

Please sign in to comment.