[#2332] Misc. fixes per code change requests.
authorIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 30 Mar 2020 16:08:37 +0000 (19:08 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Mon, 30 Mar 2020 16:08:37 +0000 (19:08 +0300)
lib/pleroma/web/activity_pub/mrf.ex
priv/repo/migrations/20200328130139_add_following_relationships_following_id_index.exs

index f5464794541330ad3996f71094f4cbdd5e82c400..a0b3af432b18ecc5cde7a84765a3f07924d7ad1a 100644 (file)
@@ -33,7 +33,7 @@ defmodule Pleroma.Web.ActivityPub.MRF do
 
   @spec subdomain_match?([Regex.t()], String.t()) :: boolean()
   def subdomain_match?(domains, host) do
-    !!Enum.find(domains, fn domain -> Regex.match?(domain, host) end)
+    Enum.any?(domains, fn domain -> Regex.match?(domain, host) end)
   end
 
   @callback describe() :: {:ok | :error, Map.t()}
index 4c9faf48f5095f4e2b8466008169d5046b0775a8..884832f84710842bf075d80a082d957623b4ea99 100644 (file)
@@ -6,6 +6,6 @@ defmodule Pleroma.Repo.Migrations.AddFollowingRelationshipsFollowingIdIndex do
   def change do
     drop_if_exists(index(:following_relationships, [:follower_id]))
 
-    create_if_not_exists(drop_if_exists(index(:following_relationships, [:following_id])))
+    create_if_not_exists(index(:following_relationships, [:following_id]))
   end
 end