We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69e83f3 commit d5051baCopy full SHA for d5051ba
lib/active_admin_import/model.rb
@@ -8,8 +8,8 @@ class Model
8
validates :file, presence: {message: Proc.new { I18n.t('active_admin_import.no_file_error') }},
9
unless: proc { |me| me.new_record? }
10
11
- validate :correct_content_type
12
- validate :file_contents_present
+ validate :correct_content_type, if: proc { |me| me.file.present? }
+ validate :file_contents_present, if: proc { |me| me.file.present? }
13
14
15
before_validation :uncompress_file, if: proc { |me| me.archive? && me.allow_archive? }
0 commit comments