fix bug with user promotions

This commit is contained in:
r888888888
2014-03-10 17:16:50 -07:00
parent 18edc937fd
commit 89a59b1b01
2 changed files with 5 additions and 4 deletions

View File

@@ -8,10 +8,11 @@ class UserPromotion
end
def promote!
validate
user.level = new_level
user.inviter_id = promoter.id
validate
create_transaction_log_item
create_user_feedback
create_dmail

View File

@@ -42,20 +42,20 @@ class Post < ActiveRecord::Base
module FileMethods
def distribute_files
RemoteFileManager.new(file_path).distribute
RemoteFileManager.new(real_preview_file_path).distribute if is_image?
RemoteFileManager.new(preview_file_path).distribute if is_image?
RemoteFileManager.new(large_file_path).distribute if has_large?
end
def delete_remote_files
RemoteFileManager.new(file_path).delete
RemoteFileManager.new(real_preview_file_path).delete if is_image?
RemoteFileManager.new(preview_file_path).delete if is_image?
RemoteFileManager.new(large_file_path).delete if has_large?
end
def delete_files
FileUtils.rm_f(file_path)
FileUtils.rm_f(large_file_path)
FileUtils.rm_f(real_preview_file_path)
FileUtils.rm_f(preview_file_path)
end
def file_path_prefix