DB restructure, print page
This commit is contained in:
@@ -19,10 +19,9 @@ module BenefitsWordDoc
|
||||
|
||||
filename = @employer.name_to_logo_filename(file_extension)
|
||||
|
||||
logo = CardLogoFile.find_or_create_by(filename: filename) do |clf|
|
||||
logo = IdCard::EmployerLogo.find_or_create_by(filename: filename) do |clf|
|
||||
clf.image_data = image_binary
|
||||
clf.content_type = meme_type
|
||||
clf.logo_type = "employer"
|
||||
end
|
||||
|
||||
# new_logo = CardLogoFile.create!(
|
||||
@@ -32,16 +31,16 @@ module BenefitsWordDoc
|
||||
# logo_type: "employer"
|
||||
# )
|
||||
|
||||
image_io = StringIO.new(image_binary)
|
||||
width, height = FastImage.size(image_io)
|
||||
image_ratio = width.to_f / height
|
||||
if (0.8..1.2).cover?(image_ratio)
|
||||
@employer.single_card_template = "FairosRxIDCard-Half"
|
||||
else
|
||||
@employer.single_card_template = "FairosRxIDCard"
|
||||
end
|
||||
# image_io = StringIO.new(image_binary)
|
||||
# width, height = FastImage.size(image_io)
|
||||
# image_ratio = width.to_f / height
|
||||
# if (0.8..1.2).cover?(image_ratio)
|
||||
# @employer.single_card_template = "FairosRxIDCard-Half"
|
||||
# else
|
||||
# @employer.single_card_template = "FairosRxIDCard"
|
||||
# end
|
||||
|
||||
@employer.employer_logo_filename = logo.filename
|
||||
@employer.id_card_configuration.employer_logo = logo
|
||||
end
|
||||
end
|
||||
@employer
|
||||
|
||||
Reference in New Issue
Block a user