aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
authorLuc Donnet2017-10-31 09:45:25 +0100
committerLuc Donnet2017-10-31 09:45:51 +0100
commitae402d2a632e9033851c4701b5b6a41767595aa9 (patch)
treecf91da73eea5ef650391a2982e579d8427df04ca /app/models
parent718d9ab7f8d5b1cd125ee341bd098c41615a0cbd (diff)
downloadchouette-core-ae402d2a632e9033851c4701b5b6a41767595aa9.tar.bz2
Fix locales problem for wrong file extension in import Refs #4816
Diffstat (limited to 'app/models')
-rw-r--r--app/models/import.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/import.rb b/app/models/import.rb
index e0aae6ef1..20e7f2d8a 100644
--- a/app/models/import.rb
+++ b/app/models/import.rb
@@ -16,9 +16,10 @@ class Import < ActiveRecord::Base
extend Enumerize
enumerize :status, in: %i(new pending successful warning failed running aborted canceled), scope: true, default: :new
+ validates :name, presence: true
validates :file, presence: true
validates_presence_of :workbench, :creator
- validates_format_of :file, with: %r{\.zip\z}i, message: I18n.t('activerecord.errors.models.imports.wrong_file_extension')
+ validates_format_of :file, with: %r{\.zip\z}i, message: I18n.t('activerecord.errors.models.import.attributes.file.wrong_file_extension')
before_create :initialize_fields