Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.16 KB | None | 0 0
  1. def randomize_file_name
  2. ext = Rack::Mime::MIME_TYPES.invert[image_content_type]
  3. self.image.instance_write(:file_name, "#{SecureRandom.uuid}#{ext}")
  4. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement