osm 1.2.18.dev.11 → 1.2.18.dev.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NmRiNTMyMmRkNGE5NmM4ZjI1YWZmNjI3NjFkZWQxNDU0YWYzOWVkZA==
4
+ NzIwZmViMGJkNTFjNzg0MjA4N2IxYmNmMGQyYTExMDEyYzU4YTUwYw==
5
5
  data.tar.gz: !binary |-
6
- MGRhNjQ3NTAxZDMxYzMxN2NmZDE5MTU4YzY5ZDBkYWE5MTEyNGNiYQ==
6
+ MzBlYjljYTQ5YTU0NDJlNjU2ZTJmNzFkNTYxZTI3NzMxMTJkYzgzNw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjkwNDIxMjRkODMyMzU2MDZkZTVmY2FjMmE3ZjkyMWUxMjhhYzhiODI3ZmZm
10
- NDBlMTljZDg1NmI0ZWExNWMzYzBmOTRiMmI0NmNmMjNhMTcyMzU3ZDFlMTg4
11
- ZGM4NjI5ZmYxNGIzY2Q1NWM0YzE1MDQ5ZTkwODcwODJmZGE2MDQ=
9
+ Y2Q2OTgwNmM1ZmVjZTNlODMyZTU1NjkxMmM1NmI5MmY4MWQ4ZWJlMGIxMTNk
10
+ MGJmMjUxNmI3NWM2MjY0NzMyZGQ0NzNmN2ZlMmVlNmY3YTRkODZhYTRiZjNl
11
+ MDA1NTBlMGU0MmQ5NDBiNjM2MDk2OTk5ZDRiMjYyMDNlNWVmNjk=
12
12
  data.tar.gz: !binary |-
13
- MWU3YWE2YjMyNThhOWY5NTVkMmQyNDk3MGZlMTg1ZDFkMTcwODQ3NWMwZWQ1
14
- MDg3MjFmMDRjZmZmZGY1MGM5ZjdlNDlmNWFjZjAyYjZlNzJlZWI4NGQxMGI1
15
- ZTY4NmMzZDExZTJjMjI3MmMwZTY3MGQ4ZDk4N2RkMDc3N2U4NTM=
13
+ NDQ4ZTgyYWViYjdmNzJjYzg4YjA0ZmNmYmJiYjNkYWU3MTMxYzBhNGU5YTU0
14
+ MDhlMmQ2NTE3NzVjZDUwOTg4ZmQ0MDEwMDY1NDJhMDNhOTBiZTYzZWVlMDNh
15
+ MzdjODAzODIyYmM1Yjg2ZWJlNjE1NDQwOGQ0MGEyMjg2ZWE1OGM=
data/lib/osm/member.rb CHANGED
@@ -217,7 +217,7 @@ module Osm
217
217
  receive_phone_2: member_contact[CID_RECIEVE_PHONE_2],
218
218
  receive_email_1: member_contact[CID_RECIEVE_EMAIL_1],
219
219
  receive_email_2: member_contact[CID_RECIEVE_EMAIL_2],
220
- additional_information: member_custom.select{ |k,v| !['title'].include?(k) },
220
+ additional_information: DirtyHashy[ member_custom.select{ |k,v| !['title'].include?(k) } ],
221
221
  additional_information_labels: custom_labels[GID_MEMBER_CONTACT],
222
222
  ),
223
223
  :primary_contact => primary_contact.nil? ? nil : PrimaryContact.new(
@@ -291,8 +291,8 @@ module Osm
291
291
  additional_information: doctor_custom,
292
292
  additional_information_labels: custom_labels[GID_DOCTOR_CONTACT],
293
293
  ),
294
- additional_information: custom_data.select{ |k,v| ! ['title'].include?(k) },
295
- additional_information_labels: custom_labels[GID_CUSTOM].select{ |k,v| ! ['title'].include?(k) },
294
+ additional_information: DirtyHashy[ custom_data.select{ |k,v| !['title'].include?(k) } ],
295
+ additional_information_labels: custom_labels[GID_CUSTOM].select{ |k,v| !['title'].include?(k) },
296
296
  )
297
297
  end
298
298
 
@@ -372,7 +372,7 @@ module Osm
372
372
 
373
373
  # Do title attribute
374
374
  if force || changed_attributes.include?('title')
375
- data = api.perform_query("ext/members/contact/?action=update", {
375
+ data = api.perform_query("ext/customdata/?action=updateColumn&section_id=#{section_id}", {
376
376
  'associated_id' => self.id,
377
377
  'associated_type' => 'member',
378
378
  'value' => title,
@@ -383,11 +383,10 @@ module Osm
383
383
  updated = updated && data.is_a?(Hash) && data['data'].is_a?(Hash) && data['data']['value'].eql?(title)
384
384
  end
385
385
 
386
-
387
386
  # Do 'floating' attributes
388
387
  if force || changed_attributes.include?('gender')
389
388
  new_value = {male: 'Male', female: 'Female', other: 'Other'}[gender] || 'Unspecified'
390
- data = api.perform_query("ext/members/contact/?action=update", {
389
+ data = api.perform_query("ext/customdata/?action=updateColumn&section_id=#{section_id}", {
391
390
  'associated_id' => self.id,
392
391
  'associated_type' => 'member',
393
392
  'value' => new_value,
@@ -737,7 +736,7 @@ module Osm
737
736
  data["data[#{attr}]"] = additional_information[attr]
738
737
  end
739
738
 
740
- updated = false
739
+ updated = true
741
740
  unless data.empty?
742
741
  result = api.perform_query("ext/customdata/?action=update&section_id=#{member.section_id}", {
743
742
  'associated_id' => member.id,
@@ -670,7 +670,7 @@ describe "Member" do
670
670
  "value" => "John",
671
671
  }}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"ok":true}'}) }
672
672
 
673
- HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/ext/members/contact/?action=update', {:body => {
673
+ HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/ext/customdata/?action=updateColumn&section_id=2', {:body => {
674
674
  "apiid" => "1",
675
675
  "token" => "API TOKEN",
676
676
  "userid" => "user_id",
@@ -785,7 +785,7 @@ describe "Member" do
785
785
  }}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"ok":true}'}) }
786
786
  end
787
787
 
788
- HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/ext/members/contact/?action=update', {:body => {
788
+ HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/ext/customdata/?action=updateColumn&section_id=2', {:body => {
789
789
  "apiid" => "1",
790
790
  "token" => "API TOKEN",
791
791
  "userid" => "user_id",
@@ -886,7 +886,7 @@ describe "Member" do
886
886
  "data[test_var]" => "This is a test",
887
887
  }}) { OsmTest::DummyHttpResult.new(:response=>{:code=>'200', :body=>'{"status":true}'}) }
888
888
 
889
- HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/ext/members/contact/?action=update', {:body => {
889
+ HTTParty.should_receive(:post).with('https://www.onlinescoutmanager.co.uk/ext/customdata/?action=updateColumn&section_id=2', {:body => {
890
890
  "apiid" => "1",
891
891
  "token" => "API TOKEN",
892
892
  "userid" => "user_id",
data/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Osm
2
- VERSION = "1.2.18.dev.11"
2
+ VERSION = "1.2.18.dev.12"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: osm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.18.dev.11
4
+ version: 1.2.18.dev.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert Gauld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-31 00:00:00.000000000 Z
11
+ date: 2015-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -287,9 +287,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
287
287
  version: 1.3.1
288
288
  requirements: []
289
289
  rubyforge_project: osm
290
- rubygems_version: 2.2.2
290
+ rubygems_version: 2.4.3
291
291
  signing_key:
292
292
  specification_version: 4
293
293
  summary: Use the Online Scout Manager API
294
294
  test_files: []
295
- has_rdoc: