Skip to content

Instantly share code, notes, and snippets.

@twerth
Created December 31, 2013 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twerth/8190843 to your computer and use it in GitHub Desktop.
Save twerth/8190843 to your computer and use it in GitHub Desktop.
Patch for NSRails to allow for additional_query_parameters
class NSRConfig
# In AppDelegate: NSRConfig.defaultConfig.additional_query_parameters = {auth_token: 'yourtoken'}
attr_accessor :additional_query_parameters
end
class NSRRequest
alias :old_http_request :HTTPRequest
def HTTPRequest
if additional_params = self.config.additional_query_parameters
self.queryParameters = {} unless self.queryParameters
self.queryParameters.merge!(additional_params)
end
old_http_request
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment