Skip to content

Commit d5051ba

Browse files
committed
ActiveAdminImport::Model validators fix
1 parent 69e83f3 commit d5051ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/active_admin_import/model.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class Model
88
validates :file, presence: {message: Proc.new { I18n.t('active_admin_import.no_file_error') }},
99
unless: proc { |me| me.new_record? }
1010

11-
validate :correct_content_type
12-
validate :file_contents_present
11+
validate :correct_content_type, if: proc { |me| me.file.present? }
12+
validate :file_contents_present, if: proc { |me| me.file.present? }
1313

1414

1515
before_validation :uncompress_file, if: proc { |me| me.archive? && me.allow_archive? }

0 commit comments

Comments
 (0)