Skip to content

Commit

Permalink
clean up validations
Browse files Browse the repository at this point in the history
  • Loading branch information
nabeta committed Dec 29, 2019
1 parent f7fb713 commit 66a9a61
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions app/models/inventory_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,24 @@ class InventoryFile < ActiveRecord::Base
has_many :items, through: :inventories
belongs_to :user

<<<<<<< HEAD
has_one_attached :inventory
=======
if ENV['ENJU_STORAGE'] == 's3'
has_attached_file :inventory, storage: :s3,
s3_credentials: {
access_key: ENV['AWS_ACCESS_KEY_ID'],
secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
bucket: ENV['S3_BUCKET_NAME']
},
s3_permissions: :private
else
has_attached_file :inventory,
path: ":rails_root/private/system/:class/:attachment/:id_partition/:style/:filename"
end
validates_attachment_content_type :inventory, content_type: ['text/csv', 'text/plain', 'text/tab-separated-values']
validates_attachment_presence :inventory
>>>>>>> 08614b0... clean up validations

paginates_per 10

Expand Down

0 comments on commit 66a9a61

Please sign in to comment.