diff --git a/lib/timeline_fu/fires.rb b/lib/timeline_fu/fires.rb index 2bf71c3..620cf69 100644 --- a/lib/timeline_fu/fires.rb +++ b/lib/timeline_fu/fires.rb @@ -16,8 +16,7 @@ def fires(event_type, opts) opts[:subject] = :self unless opts.has_key?(:subject) - method_name = :"fire_#{event_type}_after_#{opts[:on]}" - define_method(method_name) do + send(:"after_#{opts[:on]}", :if => opts[:if]) do create_options = [:actor, :subject, :secondary_subject].inject({}) do |memo, sym| if opts[sym] if opts[sym].respond_to?(:call) @@ -34,8 +33,6 @@ def fires(event_type, opts) TimelineEvent.create!(create_options) end - - send(:"after_#{opts[:on]}", method_name, :if => opts[:if]) end end end