Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. task addpicture: :environment do
  2. User.all.each do |user|
  3. user.update image: File.open(Dir.glob(File.join(Rails.root, "app", "assets", "images", "svg", "*")).sample)
  4. end
  5. end
  6.  
  7. has_attached_file :image, :default_url File.open(Dir.glob(File.join(Rails.root, "app", "assets", "images", "original", "*")).sample)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement