-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Neil Gehani
committed
Nov 13, 2013
1 parent
064a09c
commit a77b8e2
Showing
4 changed files
with
28 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
# config/initializers/paperclip.rb | ||
Paperclip::Attachment.default_options[:s3_host_name] = 'event_sample_images.s3.amazonaws.com' | ||
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename' | ||
Paperclip::Attachment.default_options[:s3_host_name] = 'event_sample_images.s3-website-us-east-1.amazonaws.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
require 'open-uri' | ||
namespace :db do | ||
desc "Fill database with sample data" | ||
task populateimage: :environment do | ||
|
||
User.all.each do |user| | ||
puts "[DEBUG] uploading images for user #{user.id} of #{User.last.id}" | ||
10.times do |n| | ||
image = open('http://s3.amazonaws.com/event_sample_images').sample | ||
description = %w(cool awesome crazy wow adorbs incredible).sample | ||
user.pins.create!(image: image, description: description) | ||
end | ||
end | ||
end | ||
end |