Permalink
Browse files

Work around a problem in integration environments with Rails where no…

… post parameters are set
  • Loading branch information...
1 parent 6e76717 commit 26758b71bf791c7a3f9f8801555a1415e6770c0a @mmangino mmangino committed Apr 3, 2009
Showing with 9 additions and 4 deletions.
  1. +2 −2 facebooker.gemspec
  2. +6 −1 lib/facebooker/rails/facebook_url_rewriting.rb
  3. +1 −1 lib/facebooker/version.rb
View
@@ -2,11 +2,11 @@
Gem::Specification.new do |s|
s.name = %q{facebooker}
- s.version = "1.0.25"
+ s.version = "1.0.26"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Chad Fowler", "Patrick Ewing", "Mike Mangino", "Shane Vitarana", "Corey Innis"]
- s.date = %q{2009-03-31}
+ s.date = %q{2009-04-03}
s.description = %q{Facebooker is a Ruby wrapper over the Facebook[http://facebook.com] {REST API}[http://wiki.developers.facebook.com/index.php/API]. Its goals are: * Idiomatic Ruby * No dependencies outside of the Ruby standard library (This is true with Rails 2.1. Previous Rails versions require the JSON gem) * Concrete classes and methods modeling the Facebook data, so it's easy for a Rubyist to understand what's available * Well tested}
s.email = %q{mmangino@elevatedrails.com}
s.extra_rdoc_files = ["CHANGELOG.rdoc", "COPYING.rdoc", "README.rdoc", "TODO.rdoc"]
@@ -27,7 +27,12 @@ def link_to_new_canvas?
def link_to_canvas?(params, options)
option_override = options[:canvas]
return false if option_override == false # important to check for false. nil should use default behavior
- option_override || @request.parameters["fb_sig_in_canvas"] == "1" || @request.parameters[:fb_sig_in_canvas] == "1"
+ option_override || (can_safely_access_request_parameters? && (@request.parameters["fb_sig_in_canvas"] == "1" || @request.parameters[:fb_sig_in_canvas] == "1" ))
+ end
+
+ #rails blindly tries to merge things that may be nil into the parameters. Make sure this won't break
+ def can_safely_access_request_parameters?
+ @request.request_parameters
end
def rewrite_url_with_facebooker(*args)
@@ -2,7 +2,7 @@ module Facebooker #:nodoc:
module VERSION #:nodoc:
MAJOR = 1
MINOR = 0
- TINY = 25
+ TINY = 26
STRING = [MAJOR, MINOR, TINY].join('.')
end

0 comments on commit 26758b7

Please sign in to comment.