Skip to content

Commit d55e100

Browse files
committed
chore: Fix linter issues & deprecations
1 parent f8d23cb commit d55e100

File tree

6 files changed

+8
-25
lines changed

6 files changed

+8
-25
lines changed

apps/cf/lib/errors/errors.ex

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ defmodule CF.Errors do
4242
:ok
4343
end
4444

45-
defp build_occurence_data(params) do
46-
default_occurrence_data()
47-
|> add_user(params[:user])
48-
|> Map.merge(params[:data] || %{})
49-
end
50-
51-
defp default_occurrence_data() do
52-
%{
53-
"code_version" => CF.Application.version()
54-
}
55-
end
56-
5745
defp add_user(base, nil),
5846
do: base
5947

apps/db/lib/db_schema/video.ex

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,4 @@ defmodule DB.Schema.Video do
297297
)
298298
end)
299299
end
300-
301-
# Return IDs of videos with at least 3 statements
302-
defp popular_videos_subquery do
303-
Video
304-
|> join(:inner, [v], s in assoc(v, :statements))
305-
|> select([:id])
306-
|> group_by([v], v.id)
307-
|> having([v, s], count(s.id) >= 3)
308-
end
309300
end

apps/db/lib/db_type/flag_reason.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,7 @@ defmodule DB.Type.FlagReason do
6666
|> Enum.find(fn {_, id} -> id == reason_id end)
6767
|> elem(0)
6868
end
69+
70+
# Implement the embed_as/1 function required by the Ecto.Type behaviour
71+
def embed_as(_), do: :dump
6972
end

apps/db/mix.exs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ defmodule DB.Mixfile do
5555
{:mime, "~> 1.2"},
5656
{:scrivener_ecto, "~> 2.0"},
5757
{:algoliax, "~> 0.7.1"},
58+
{:httpoison, "~> 2.2"},
5859

5960
# Dev only
6061
{:exsync, "~> 0.2", only: :dev},

apps/db/test/db_schema/speaker_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule DB.Schema.SpeakerTest do
44
alias DB.Schema.Speaker
55

66
@valid_attrs %{
7-
full_name: "#{Faker.Name.first_name()} #{Faker.Name.last_name()}",
7+
full_name: "#{Faker.Person.first_name()} #{Faker.Person.last_name()}",
88
wikidata_item_id: nil
99
}
1010
@invalid_attrs %{}

apps/db/test/support/factory.ex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defmodule DB.Factory do
2525

2626
def user_factory do
2727
%User{
28-
name: Faker.Name.first_name(),
28+
name: Faker.Person.first_name(),
2929
username: "User-#{random_string(10)}",
3030
email: Faker.Internet.email(),
3131
encrypted_password: "$2b$12$fe55IfCdqNzKp1wMIJDwVeG3f7guOduEE5HS2C9IJyfkuk3avbjQG",
@@ -65,8 +65,8 @@ defmodule DB.Factory do
6565

6666
def speaker_factory do
6767
%Speaker{
68-
full_name: Faker.Name.name(),
69-
title: Faker.Name.title(),
68+
full_name: Faker.Person.name(),
69+
title: Faker.Person.title(),
7070
country: Faker.Address.country_code()
7171
}
7272
end

0 commit comments

Comments
 (0)