fix bug with user promotions
This commit is contained in:
@@ -8,10 +8,11 @@ class UserPromotion
|
|||||||
end
|
end
|
||||||
|
|
||||||
def promote!
|
def promote!
|
||||||
|
validate
|
||||||
|
|
||||||
user.level = new_level
|
user.level = new_level
|
||||||
user.inviter_id = promoter.id
|
user.inviter_id = promoter.id
|
||||||
|
|
||||||
validate
|
|
||||||
create_transaction_log_item
|
create_transaction_log_item
|
||||||
create_user_feedback
|
create_user_feedback
|
||||||
create_dmail
|
create_dmail
|
||||||
|
|||||||
@@ -42,20 +42,20 @@ class Post < ActiveRecord::Base
|
|||||||
module FileMethods
|
module FileMethods
|
||||||
def distribute_files
|
def distribute_files
|
||||||
RemoteFileManager.new(file_path).distribute
|
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?
|
RemoteFileManager.new(large_file_path).distribute if has_large?
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_remote_files
|
def delete_remote_files
|
||||||
RemoteFileManager.new(file_path).delete
|
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?
|
RemoteFileManager.new(large_file_path).delete if has_large?
|
||||||
end
|
end
|
||||||
|
|
||||||
def delete_files
|
def delete_files
|
||||||
FileUtils.rm_f(file_path)
|
FileUtils.rm_f(file_path)
|
||||||
FileUtils.rm_f(large_file_path)
|
FileUtils.rm_f(large_file_path)
|
||||||
FileUtils.rm_f(real_preview_file_path)
|
FileUtils.rm_f(preview_file_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
def file_path_prefix
|
def file_path_prefix
|
||||||
|
|||||||
Reference in New Issue
Block a user