Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow the rack middle_ware to fall back from after RewindableInput to…

… after Session::CookieStore if RewindableInput is not available. It was removed somewhere in Rails 2.3
  • Loading branch information...
commit 6d05d296c32a05fae3343aee93da4da4dff5a171 1 parent 363a4f2
Matthew Beale authored committed
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/facebooker/rails/extensions/rack_setup.rb
8 lib/facebooker/rails/extensions/rack_setup.rb
@@ -1,2 +1,8 @@
+# Somewhere in 2.3 RewindableInput was removed- rack supports it natively
require 'rack/facebook'
-ActionController::Dispatcher.middleware.insert_after 'ActionController::RewindableInput',Rack::Facebook, Facebooker.secret_key
+ (Object.const_get('ActionController::RewindableInput') rescue false) ?
+ 'ActionController::RewindableInput' :
+ 'ActionController::Session::CookieStore',
+ Rack::Facebook,
+ Facebooker.secret_key )
Please sign in to comment.
Something went wrong with that request. Please try again.