Sha256: a0850876f9192e96ba1a4b5a0ddbf9c5ad5a19a656c4cd4eb3e4457cf92a0faa

Contents?: true

Size: 876 Bytes

Versions: 4

Compression:

Stored size: 876 Bytes

Contents

module ::ActionController

  class Request

    include Facebooker::Rails::BackwardsCompatibleParamChecks

    def request_method_with_facebooker
      if parameters[:_method].blank?
        if %w{GET HEAD}.include?(parameters[:fb_sig_request_method])
          parameters[:_method] = parameters[:fb_sig_request_method]
        end
      end
      request_method_without_facebooker
    end

    if new({}).methods.include?("request_method")
      alias_method_chain :request_method, :facebooker
    end

    def xml_http_request_with_facebooker?
      one_or_true(parameters["fb_sig_is_mockajax"])  ||
      one_or_true(parameters["fb_sig_is_ajax"]) ||
      xml_http_request_without_facebooker?
    end
    alias_method_chain :xml_http_request?, :facebooker

    # we have to re-alias xhr? since it was pointing to the old method
    alias xhr? :xml_http_request?

  end
end

Version data entries

4 entries across 4 versions & 3 rubygems

Version Path
fs-facebooker-1.0.37 lib/facebooker/rails/facebook_request_fix_2-3.rb
mmangino-facebooker-1.0.36 lib/facebooker/rails/facebook_request_fix_2-3.rb
mmangino-facebooker-1.0.37 lib/facebooker/rails/facebook_request_fix_2-3.rb
taweili-facebooker-1.0.37 lib/facebooker/rails/facebook_request_fix_2-3.rb