MissionHub 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ module MissionHub
21
21
  def request(method, path, *arguments)
22
22
  result = ActiveSupport::Notifications.instrument("request.active_resource") do |payload|
23
23
  path = add_secret_to_path(path)
24
+ path = add_org_to_path(path)
24
25
  payload[:method] = method
25
26
  payload[:request_uri] = "#{site.scheme}://#{site.host}:#{site.port}#{path}"
26
27
  payload[:result] = http.send(method, path, *arguments)
@@ -39,5 +40,13 @@ module MissionHub
39
40
  end
40
41
  path
41
42
  end
43
+
44
+ def add_org_to_path(path)
45
+ unless path.include?('organization_id=') or Thread.current["mission_hub.organization_id"].nil?
46
+ path += path.include?('?') ? '&' : '?'
47
+ path += "organization_id=#{Thread.current["mission_hub.organization_id"]}"
48
+ end
49
+ path
50
+ end
42
51
  end
43
52
  end
@@ -13,7 +13,8 @@ module MissionHub
13
13
  # An array of valid keys in the options hash when configuring a {Twitter::Client}
14
14
  VALID_OPTIONS_KEYS = [
15
15
  :client_secret,
16
- :site
16
+ :site,
17
+ :organization_id
17
18
  ]
18
19
 
19
20
  # When this module is extended, set all configuration options to their default values
@@ -1,3 +1,3 @@
1
1
  module MissionHub
2
- VERSION = "2.1.1"
2
+ VERSION = "2.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: MissionHub
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-08 00:00:00.000000000 Z
12
+ date: 2013-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest