core/app/models/gaku/template.rb in gaku-0.1.1 vs core/app/models/gaku/template.rb in gaku-0.2.0

- old
+ new

@@ -1,18 +1,16 @@ module Gaku class Template < ActiveRecord::Base - has_attached_file :file - validates_with AttachmentContentTypeValidator, attributes: :file, content_type: - [ - 'text/plain', - 'application/vnd.ms-excel', - 'application/vnd.oasis.opendocument.spreadsheet', - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - ], message: I18n.t(:'template.file_type_error') + validates_with AttachmentContentTypeValidator, + attributes: :file, + content_type: ['text/plain', + 'application/vnd.ms-excel', + 'application/vnd.oasis.opendocument.spreadsheet', + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'], + message: I18n.t(:'template.file_type_error') validates :name, :context, presence: true validates :file, presence: true, on: :create - end end