Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return_attachment_instance_on_save_if_already_persisted #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Attachment/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ export class ResponsiveAttachment implements ResponsiveAttachmentContract {
* instance is not local
*/
if (!this.isLocal || this.isPersisted) {
return
return this
}

/**
Expand Down
20 changes: 13 additions & 7 deletions src/Bindings/Validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum ImageDimensionsValidationRule {
* Ensure image is complaint with expected dimensions validations
*/
class ImageDimensionsCheck {
constructor (public ruleName: ImageDimensionsValidationRule, protected logger: LoggerContract) { }
constructor(public ruleName: ImageDimensionsValidationRule, protected logger: LoggerContract) {}

/**
* Compile validation options
Expand Down Expand Up @@ -70,7 +70,8 @@ class ImageDimensionsCheck {
pointer,
this.ruleName,
`${this.ruleName} validation failure`,
arrayExpressionPointer, { [this.ruleName]: validationValue }
arrayExpressionPointer,
{ [this.ruleName]: validationValue }
)
}

Expand Down Expand Up @@ -145,7 +146,8 @@ export function extendValidator(validator: typeof validatorStatic, logger: Logge
options.pointer,
`${minImageWidthRuleChecker.ruleName}`,
`${minImageWidthRuleChecker.ruleName} validation failure`,
options.arrayExpressionPointer, { [minImageWidthRuleChecker.ruleName]: compiledOptions.validationValue }
options.arrayExpressionPointer,
{ [minImageWidthRuleChecker.ruleName]: compiledOptions.validationValue }
)
}
},
Expand Down Expand Up @@ -178,7 +180,8 @@ export function extendValidator(validator: typeof validatorStatic, logger: Logge
options.pointer,
`${minImageHeightRuleChecker.ruleName}`,
`${minImageHeightRuleChecker.ruleName} validation failure`,
options.arrayExpressionPointer, { [minImageHeightRuleChecker.ruleName]: compiledOptions.validationValue }
options.arrayExpressionPointer,
{ [minImageHeightRuleChecker.ruleName]: compiledOptions.validationValue }
)
}
},
Expand Down Expand Up @@ -211,7 +214,8 @@ export function extendValidator(validator: typeof validatorStatic, logger: Logge
options.pointer,
`${maxImageWidthRuleChecker.ruleName}`,
`${maxImageWidthRuleChecker.ruleName} validation failure`,
options.arrayExpressionPointer, { [maxImageWidthRuleChecker.ruleName]: compiledOptions.validationValue }
options.arrayExpressionPointer,
{ [maxImageWidthRuleChecker.ruleName]: compiledOptions.validationValue }
)
}
},
Expand Down Expand Up @@ -244,7 +248,8 @@ export function extendValidator(validator: typeof validatorStatic, logger: Logge
options.pointer,
`${maxImageHeightRuleChecker.ruleName}`,
`${maxImageHeightRuleChecker.ruleName} validation failure`,
options.arrayExpressionPointer, { [maxImageHeightRuleChecker.ruleName]: compiledOptions.validationValue }
options.arrayExpressionPointer,
{ [maxImageHeightRuleChecker.ruleName]: compiledOptions.validationValue }
)
}
},
Expand Down Expand Up @@ -274,7 +279,8 @@ export function extendValidator(validator: typeof validatorStatic, logger: Logge
options.pointer,
`${aspectRatioRuleChecker.ruleName}`,
`${aspectRatioRuleChecker.ruleName} validation failure`,
options.arrayExpressionPointer, { [aspectRatioRuleChecker.ruleName]: compiledOptions.validationValue }
options.arrayExpressionPointer,
{ [aspectRatioRuleChecker.ruleName]: compiledOptions.validationValue }
)
}
},
Expand Down
Loading