Skip to content

Commit

Permalink
minor fix so users cant set session_workaround.action
Browse files Browse the repository at this point in the history
  • Loading branch information
rdetert committed Jan 29, 2011
1 parent 7c4db88 commit bc1910d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
10 changes: 8 additions & 2 deletions README
Expand Up @@ -22,11 +22,17 @@ TODO:
CHANGELOG:
January 28, 2011
1. Completely re-wrote the 'edit' portion
2. Session variables were disappearing randomly (no idea why). As a workaround, I made my own mini session handling using ActiveRecord.
Session variables would disappear and reappear between requests about 10% of the time, so I added a SessionWorkaround model that holds the action state, as well as the session_id. The session_id doesn't appear to change at all. I tried using an ActiveRecord Session Store, but this caused issues with the Uploadify Middleware workaround.

2. Session variables were disappearing randomly (no idea why).
As a workaround, I made my own mini session handling using ActiveRecord.
Session variables would disappear and reappear between requests about 10% of the time,
so I added a SessionWorkaround model that holds the action state, as well as the session_id.
The session_id doesn't appear to change at all.
I tried using an ActiveRecord Session Store, but this caused issues with the Uploadify Middleware workaround.

January 23, 2011
1. Added form edit

2. Verified it works in production mode in Mongrel/WebBrick/Passenger


Expand Down
3 changes: 2 additions & 1 deletion app/controllers/posts_controller.rb
Expand Up @@ -104,7 +104,8 @@ def update
private

def translate_action
@_action = params[:_action] || SessionWorkaround.translate_action(params[:action])
action = params[:_action] || params[:action]
@_action = SessionWorkaround.translate_action(action)
end

def get_image_uploads
Expand Down
3 changes: 2 additions & 1 deletion app/models/session_workaround.rb
Expand Up @@ -3,6 +3,7 @@ class SessionWorkaround < ActiveRecord::Base

def self.translate_action(action)
return "new" if action == "new" or action == "create"
return "edit" if action == "edit" or action == "update"
return "edit" if action == "edit" or action == "update"
nil
end
end

0 comments on commit bc1910d

Please sign in to comment.