Class: Pageflow::ThemeCustomizationFile::AttachmentContentTypeValidator Private
- Inherits:
-
Paperclip::Validators::AttachmentContentTypeValidator
- Object
- Paperclip::Validators::AttachmentContentTypeValidator
- Pageflow::ThemeCustomizationFile::AttachmentContentTypeValidator
- Defined in:
- app/models/pageflow/theme_customization_file.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Paperclip requires a content type validator for security reasons. Sub-classes are fine, though. The original validator does not provide a way to dynamically determine the permitted content types.
Instance Method Summary collapse
-
#check_validity! ⇒ Object
private
Override to not require :content_type option.
- #validate_whitelist(record, attribute, value) ⇒ Object private
Instance Method Details
#check_validity! ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Override to not require :content_type option.
27 28 29 |
# File 'app/models/pageflow/theme_customization_file.rb', line 27 def check_validity! true end |
#validate_whitelist(record, attribute, value) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
21 22 23 24 |
# File 'app/models/pageflow/theme_customization_file.rb', line 21 def validate_whitelist(record, attribute, value) return if value =~ record.[:content_type] record.errors.add(attribute, :invalid) end |