Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
added session hack for activerecord sessions to allow multiple photo …
Browse files Browse the repository at this point in the history
…uploading
  • Loading branch information
bborn committed Mar 31, 2009
1 parent 87c8f61 commit f9984aa
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions engine_config/initializers/sessions_hack.rb
Expand Up @@ -27,3 +27,18 @@ def read_cookie
@session_data || @session.cgi.cookies[@cookie_options['name']].first
end
end



class CGI::Session::ActiveRecordStore
alias original_initialize initialize

def initialize(session, option = nil)
if option.include?("session_data")
session.instance_variable_set('@session_id', option
["session_data"]) unless option["session_data"].empty?
end
original_initialize(session, option)
end
end

1 comment on commit f9984aa

@sprite2005
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:)

Please sign in to comment.