[deploy] Move from OpenStruct to Struct (#9429)

This commit is contained in:
Michael Kohl 2020-07-27 14:31:48 +07:00 committed by GitHub
parent c493ad1d2a
commit a80d3f9082
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -17,7 +17,6 @@ Performance/OpenStruct:
Exclude:
- 'app/models/article.rb'
- 'app/models/organization.rb'
- 'app/services/notifications/reactions/send.rb'
- 'spec/models/github_repo_spec.rb'
- 'spec/requests/github_repos_spec.rb'

View file

@ -2,6 +2,8 @@
module Notifications
module Reactions
class Send
Response = Struct.new(:action, :notification_id)
# @param reaction_data [Hash]
# * :reactable_id [Integer] - article or comment id
# * :reactable_type [String] - "Article" or "Comment"
@ -46,7 +48,7 @@ module Notifications
if aggregated_reaction_siblings.size.zero?
Notification.where(notification_params).delete_all
OpenStruct.new(action: :deleted)
Response.new(:deleted)
else
recent_reaction = reaction_siblings.first
@ -64,7 +66,7 @@ module Notifications
notification_id = save_notification(notification_params, notification)
OpenStruct.new(action: :saved, notification_id: notification_id)
Response.new(:saved, notification_id)
end
end