module DynamicImage::Model::Validations
DynamicImage
Model
Validations
¶ ↑
Validates that all necessary attributes are valid. All of these are managed by DynamicImage::Model
, so this is mostly for enforcing integrity.
Private Instance Methods
Source
# File lib/dynamic_image/model/validations.rb, line 71 def validate_crop_bounds required_size = crop_start + crop_size return unless required_size.x > real_size.x || required_size.y > real_size.y errors.add(:crop_size, "is out of bounds") end
Source
# File lib/dynamic_image/model/validations.rb, line 79 def validate_image errors.add(:data, :invalid) unless valid_image? end