Packages
ami_models
0.1.0
Package containing all AMI Models shared between micro-services.
Retired package: Deprecated - faulty
Current section
Files
Jump to
Current section
Files
lib/ami/thumb_image.ex
defmodule Ami.ThumbImage do
use Ecto.Schema
schema "thumb_images" do
field(:name, :string)
field(:file, :string)
field(:course_id, :integer)
end
def thumb_image_for_course(struct) do
ti = List.last(struct)
if ti != nil,
do: "https://ami-aws-staging.s3.amazonaws.com/uploads/thumb_image/file/#{ti.id}/#{ti.file}"
end
end