diff options
| author | mo khan <mo@mokhan.ca> | 2015-01-17 12:52:51 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2015-01-17 12:52:51 -0700 |
| commit | 44ffb735056d225c784da087af8cf3eb72ebfeb9 (patch) | |
| tree | c34479d674166b5b3ed2789c61ac77b3c426e41e /app/controllers | |
| parent | 3f34a83426adf7ee4dfd1b0b75514651818daef5 (diff) | |
inline publish method.
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/my/avatars_controller.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/app/controllers/my/avatars_controller.rb b/app/controllers/my/avatars_controller.rb index c88ba638..4c297bdd 100644 --- a/app/controllers/my/avatars_controller.rb +++ b/app/controllers/my/avatars_controller.rb @@ -10,16 +10,13 @@ module My end def create - publish(params[:photo][:image]) + image = params[:photo][:image] + ProcessAvatarJob.perform_later(current_user, move_to_temporary_storage(image)) redirect_to new_my_avatar_path, notice: t(:avatar_uploaded) end private - def publish(image) - ProcessAvatarJob.perform_later(current_user, move_to_temporary_storage(image)) - end - def move_to_temporary_storage(image) "#{create_tmp_dir}/#{image.original_filename}".tap do |new_path| FileUtils.mv(image.path, new_path) |
