Skip to content

Commit

Permalink
Implement suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 committed Aug 6, 2023
1 parent 2224b08 commit 5b2e13f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/atomic/organizations/organization.ex
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ defmodule Atomic.Organizations.Organization do
embeds_one :card, Card, on_replace: :delete

has_many :news, New,
on_replace: :delete_if_exists,
on_delete: :delete_all,
foreign_key: :organization_id,
on_replace: :delete,
preload_order: [asc: :title]

timestamps()
Expand Down
6 changes: 3 additions & 3 deletions lib/atomic/uploaders/partner_image.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
defmodule Atomic.Uploaders.PartnerImage do
@moduledoc """
ProductImage is used for product images.
PartnerImage is used for partners images.
"""

use Waffle.Definition
Expand Down Expand Up @@ -35,11 +35,11 @@ defmodule Atomic.Uploaders.PartnerImage do
end

def storage_dir(_version, {_file, %Partner{} = scope}) do
"uploads/store/#{scope.id}"
"uploads/partners/#{scope.id}"
end

# Provide a default URL if there hasn't been a file uploaded
def default_url(version) do
"uploads/store/partner_image_#{version}.png"
"uploads/partners/partner_image_#{version}.png"
end
end

0 comments on commit 5b2e13f

Please sign in to comment.