Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 390
- Log:
Initial import of Canvass, a donations-based poll application.
- Author:
- rool
- Date:
- Mon Mar 21 14:58:04 +0000 2011
- Size:
- 1179 Bytes
1 | ######################################################################## |
2 | # File:: session_store.rb |
3 | # (C):: https://gist.github.com/570149 |
4 | # |
5 | # Purpose:: Rails 2.3.9 and 2.3.10 don't work properly when either |
6 | # ActiveRecord or MemCache are used for the session store. |
7 | # Although Canvass isn't configured that way by default, |
8 | # this patch is included in an attempt to keep things from |
9 | # breaking should an installer choose an affected store. |
10 | # ---------------------------------------------------------------------- |
11 | # 27-Jan-2011 (ADH): Created. |
12 | ######################################################################## |
13 | |
14 | affected = %w[ActiveRecord::SessionStore ActionController::Session::MemCacheStore] |
15 | |
16 | target = Rails.configuration.middleware.detect do |mid| |
17 | mid.klass.is_a? Class and affected.include? mid.klass.to_s |
18 | end |
19 | |
20 | if target |
21 | class RailsCookieMonster |
22 | def initialize(app) |
23 | @app = app |
24 | end |
25 | |
26 | def call(env) |
27 | # monster MUST HAVE COOKIES om nom nom nom |
28 | env['HTTP_COOKIE'] ||= "" |
29 | @app.call(env) |
30 | end |
31 | end |
32 | |
33 | Rails.configuration.middleware.insert_before target, RailsCookieMonster |
34 | end |