ruby on rails - Paperclip and S3 storage seed -
i've setup rails 4 app use s3 storage on paperclip gem. upload of files working through create method, images show using = image_tag(@listing.avatar.url)
... problem have when use seed_dump
, create seed.db; reset database , seed data again paths s3 images not correct anymore?!
application.rb
config.paperclip_defaults = { :storage => :s3, :s3_credentials => { :bucket => env['fog_directory'], :access_key_id => env['aws_access_key_id'], :secret_access_key => env['aws_secret_access_key'] } }
listing.rb
has_attached_file :avatar validates_attachment_content_type :avatar, :content_type => /\aimage\/.*\z/
long story short: how dump data , seed again without losing avatar url?
Comments
Post a Comment