[deploy] Move from OpenStruct to Struct (#9429)
This commit is contained in:
parent
c493ad1d2a
commit
a80d3f9082
2 changed files with 4 additions and 3 deletions
|
|
@ -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'
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue