lib/timeline_fu/fires.rb in mcfearsome-timeline_fu-0.1.2 vs lib/timeline_fu/fires.rb in mcfearsome-timeline_fu-0.2.0
- old
+ new
@@ -10,12 +10,12 @@
method_name = :"fire_#{event_type}_after_#{opts[:on]}"
define_method(method_name) do
create_options = [:actor, :subject, :secondary_subject].inject({}) do |memo, sym|
memo[sym] = send(opts[sym]) if opts[sym] and opts[sym] != :self
+ memo[sym] ||= self if opts[sym] == :self or sym == :subject
memo
end
- create_options[:subject] ||= self
create_options[:event_type] = event_type.to_s
if create_options[:secondary_subject].class == Array
create_options_col = create_options[:secondary_subject].map do |secondary_subject|
create_options.merge({:secondary_subject => secondary_subject})