Skip to content

Commit

Permalink
chore: Fix linter issues & deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Jun 27, 2024
1 parent f8d23cb commit d55e100
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 25 deletions.
12 changes: 0 additions & 12 deletions apps/cf/lib/errors/errors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,6 @@ defmodule CF.Errors do
:ok
end

defp build_occurence_data(params) do
default_occurrence_data()
|> add_user(params[:user])
|> Map.merge(params[:data] || %{})
end

defp default_occurrence_data() do
%{
"code_version" => CF.Application.version()
}
end

defp add_user(base, nil),
do: base

Expand Down
9 changes: 0 additions & 9 deletions apps/db/lib/db_schema/video.ex
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,4 @@ defmodule DB.Schema.Video do
)
end)
end

# Return IDs of videos with at least 3 statements
defp popular_videos_subquery do
Video
|> join(:inner, [v], s in assoc(v, :statements))
|> select([:id])
|> group_by([v], v.id)
|> having([v, s], count(s.id) >= 3)
end
end
3 changes: 3 additions & 0 deletions apps/db/lib/db_type/flag_reason.ex
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,7 @@ defmodule DB.Type.FlagReason do
|> Enum.find(fn {_, id} -> id == reason_id end)
|> elem(0)
end

# Implement the embed_as/1 function required by the Ecto.Type behaviour
def embed_as(_), do: :dump
end
1 change: 1 addition & 0 deletions apps/db/mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ defmodule DB.Mixfile do
{:mime, "~> 1.2"},
{:scrivener_ecto, "~> 2.0"},
{:algoliax, "~> 0.7.1"},
{:httpoison, "~> 2.2"},

# Dev only
{:exsync, "~> 0.2", only: :dev},
Expand Down
2 changes: 1 addition & 1 deletion apps/db/test/db_schema/speaker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule DB.Schema.SpeakerTest do
alias DB.Schema.Speaker

@valid_attrs %{
full_name: "#{Faker.Name.first_name()} #{Faker.Name.last_name()}",
full_name: "#{Faker.Person.first_name()} #{Faker.Person.last_name()}",
wikidata_item_id: nil
}
@invalid_attrs %{}
Expand Down
6 changes: 3 additions & 3 deletions apps/db/test/support/factory.ex
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ defmodule DB.Factory do

def user_factory do
%User{
name: Faker.Name.first_name(),
name: Faker.Person.first_name(),
username: "User-#{random_string(10)}",
email: Faker.Internet.email(),
encrypted_password: "$2b$12$fe55IfCdqNzKp1wMIJDwVeG3f7guOduEE5HS2C9IJyfkuk3avbjQG",
Expand Down Expand Up @@ -65,8 +65,8 @@ defmodule DB.Factory do

def speaker_factory do
%Speaker{
full_name: Faker.Name.name(),
title: Faker.Name.title(),
full_name: Faker.Person.name(),
title: Faker.Person.title(),
country: Faker.Address.country_code()
}
end
Expand Down

0 comments on commit d55e100

Please sign in to comment.