Permalink
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...
1 parent 363a4f2 commit 6d05d296c32a05fae3343aee93da4da4dff5a171 Matthew Beale committed with May 8, 2009
Showing with 7 additions and 1 deletion.
  1. +7 −1 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
+ActionController::Dispatcher.middleware.insert_after(
+ (Object.const_get('ActionController::RewindableInput') rescue false) ?
+ 'ActionController::RewindableInput' :
+ 'ActionController::Session::CookieStore',
+ Rack::Facebook,
+ Facebooker.secret_key )

0 comments on commit 6d05d29

Please sign in to comment.