Before a few renames
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
module IdCard
|
||||
class EmployerLogo < ApplicationRecord
|
||||
before_save :calculate_aspect_ratio, if: :image_data_changed?
|
||||
before_validation :calculate_aspect_ratio, if: :image_data_changed?
|
||||
|
||||
private
|
||||
|
||||
def calculate_aspect_ratio
|
||||
image_io = StringIO.new(image_data)
|
||||
image_io = StringIO.new(self.image_data)
|
||||
width, height = FastImage.size(image_io)
|
||||
image_ratio = width.to_f / height
|
||||
if image_ratio
|
||||
aspect_ratio = image_ratio.round(2)
|
||||
self.aspect_ratio = image_ratio.round(2)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -7,7 +7,7 @@ module IdCard
|
||||
class << self
|
||||
|
||||
def medcost
|
||||
defaults.where("filename LIKE ?", "%Medcost%")
|
||||
defaults.where("filename LIKE ?", "%MedCost%")
|
||||
end
|
||||
|
||||
def cigna
|
||||
|
||||
@@ -47,6 +47,7 @@ module IdCard
|
||||
def permitted_params(params)
|
||||
params.require(:id_card_configuration).permit(
|
||||
plans_attributes: [
|
||||
:id,
|
||||
:title,
|
||||
:pb_product_key,
|
||||
:pl_plan_key,
|
||||
|
||||
Reference in New Issue
Block a user