Permalink
Browse files

update avatar s3 info

avatars are attached to the user profile, removed the items from user model
  • Loading branch information...
1 parent d8d1d4f commit 6a838728193504f417ca6cd49f776d62a6770463 Kevin Solorio committed Jun 15, 2012
Showing with 12 additions and 8 deletions.
  1. +0 −7 app/models/user.rb
  2. +12 −1 app/models/user_profile.rb
View
@@ -12,9 +12,6 @@ class User < ActiveRecord::Base
has_one :user_address, :dependent => :destroy
has_many :orders, :as => :customer
- has_attached_file :avatar,
- :styles => { :medium => "100x100>", :thumb => "50x50" }
-
acts_as_authentic do |c|
c.session_class = UserSession
c.logged_in_timeout = 4.hours
@@ -30,10 +27,6 @@ class User < ActiveRecord::Base
attr_reader :per_page
@@per_page = 3
- def avatar_file_name
-
- end
-
def display_name
"#{first_name} #{last_name}"
end
@@ -1,3 +1,14 @@
class UserProfile < ActiveRecord::Base
belongs_to :user
-end
+
+ has_attached_file :avatar,
+ :styles => { :medium => "100x100>", :thumb => "50x50" },
+ :storage => :s3,
+ :bucket => Cleveland2030Settings.config['S3_BUCKET'],
+ :s3_credentials => {
+ :access_key_id => Cleveland2030Settings.config['S3_KEY'],
+ :secret_access_key => Cleveland2030Settings.config['S3_SECRET']
+ },
+ :path => "avatar/:id/:style/:filename"
+
+end

0 comments on commit 6a83872

Please sign in to comment.