FEATURE: support email attachments

This commit is contained in:
Régis Hanol
2014-04-14 22:55:57 +02:00
parent ed6e2b1d79
commit 2505d18aa9
29 changed files with 432 additions and 538 deletions

View File

@ -527,13 +527,18 @@ class User < ActiveRecord::Base
created_at > 1.day.ago
end
def upload_avatar(avatar)
def upload_avatar(upload)
self.uploaded_avatar_template = nil
self.uploaded_avatar = avatar
self.uploaded_avatar = upload
self.use_uploaded_avatar = true
self.save!
end
def upload_profile_background(upload)
self.profile_background = upload.url
self.save!
end
def generate_api_key(created_by)
if api_key.present?
api_key.regenerate!(created_by)