Skip to content

Commit

Permalink
Fixed error calling #notify for callbacks
Browse files Browse the repository at this point in the history
When tracked_option was expanded into the argument list, if non-empty it pushed extraneous arguments
  • Loading branch information
upstill authored Nov 8, 2017
1 parent e21d7ee commit 8f6f0c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/activity_notification/roles/acts_as_notifiable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@ def add_tracked_callbacks(target_type, tracked_option = {})
add_tracked_callback(tracked_callbacks, :create, ->{ notify target_type, tracked_option })
add_tracked_callback(tracked_callbacks, :update, ->{ notify target_type, tracked_option })
else
add_tracked_callback(tracked_callbacks, :create, ->{ notify target_type, *tracked_option, key: notification_key_for_tracked_creation })
add_tracked_callback(tracked_callbacks, :update, ->{ notify target_type, *tracked_option, key: notification_key_for_tracked_update })
add_tracked_callback(tracked_callbacks, :create, ->{ notify target_type, tracked_option.merge(key: notification_key_for_tracked_creation) })
add_tracked_callback(tracked_callbacks, :update, ->{ notify target_type, tracked_option.merge(key: notification_key_for_tracked_update) })
end
{ tracked: tracked_callbacks }
end
Expand Down

0 comments on commit 8f6f0c3

Please sign in to comment.