Run rubocop -a

This commit is contained in:
Jeremy Kescher 2023-05-09 23:41:48 +02:00
parent 31d9da6172
commit c781b34278
No known key found for this signature in database
GPG key ID: 80A419A7A613DFA4
6 changed files with 20 additions and 19 deletions

View file

@ -10,7 +10,7 @@ class ActivityPub::Activity::EmojiReact < ActivityPub::Activity
@account.reacted?(original_status, name) @account.reacted?(original_status, name)
custom_emoji = nil custom_emoji = nil
if name =~ /^:.*:$/ if /^:.*:$/.match?(name)
process_emoji_tags(@json['tag']) process_emoji_tags(@json['tag'])
name.delete! ':' name.delete! ':'

View file

@ -22,7 +22,7 @@ class ActivityPub::Activity::Like < ActivityPub::Activity
return false if name.nil? return false if name.nil?
custom_emoji = nil custom_emoji = nil
if name =~ /^:.*:$/ if /^:.*:$/.match?(name)
process_emoji_tags(@json['tag']) process_emoji_tags(@json['tag'])
name.delete! ':' name.delete! ':'

View file

@ -1,4 +1,5 @@
# frozen_string_literal: true # frozen_string_literal: true
# == Schema Information # == Schema Information
# #
# Table name: status_reactions # Table name: status_reactions

View file

@ -18,8 +18,8 @@ namespace :api, format: false do
# foreign custom emojis are encoded as shortcode@domain.tld # foreign custom emojis are encoded as shortcode@domain.tld
# the constraint prevents rails from interpreting the ".tld" as a filename extension # the constraint prevents rails from interpreting the ".tld" as a filename extension
post '/react/:id', to: 'reactions#create', constraints: { id: /[^\/]+/ } post '/react/:id', to: 'reactions#create', constraints: { id: %r{[^/]+} }
post '/unreact/:id', to: 'reactions#destroy', constraints: { id: /[^\/]+/ } post '/unreact/:id', to: 'reactions#destroy', constraints: { id: %r{[^/]+} }
resource :bookmark, only: :create resource :bookmark, only: :create
post :unbookmark, to: 'bookmarks#destroy' post :unbookmark, to: 'bookmarks#destroy'

View file

@ -1,6 +1,6 @@
Fabricator(:status_reaction) do Fabricator(:status_reaction) do
account nil account nil
status nil status nil
name "MyString" name 'MyString'
custom_emoji nil custom_emoji nil
end end