Skip to content

Commit

Permalink
Fix session[:edit] breakage in picture controller.
Browse files Browse the repository at this point in the history
When picture controller is accessed the current content of
session[:edit] is lost. This is due to asymetry in
get_global_session_data vs set_global_session_data. One side always sets
the session[:edit] while the other does not always read it.

Furthemor the logic of {set/get}_global_session_data is not needed in
the picture controller.
  • Loading branch information
martinpovolny committed Nov 16, 2017
1 parent 7b2c002 commit 612b95d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/picture_controller.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class PictureController < ApplicationController
skip_before_action :get_global_session_data
skip_after_action :set_global_session_data

def show # GET /pictures/:basename
compressed_id, extension = params[:basename].split('.')
picture = Picture.find_by_id(from_cid(compressed_id))
Expand Down

0 comments on commit 612b95d

Please sign in to comment.