active_zuora 2.2.4 → 2.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: e60e46200f06789b5ea3a830d80a4870f4ccd42f
4
- data.tar.gz: e90690d993f273186a531f7c063056bb12e54478
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZTRiOWNkMmNiMWQwM2MyNTY2YjQwMjVmMWI5ZmY0MGYwMGI0Y2U2Nw==
5
+ data.tar.gz: !binary |-
6
+ NjYzYmNjYWQ4YWQ1Mzk1ZjE4MTIzYTViMzk5YjYxMGQ5MmIwNDMxMA==
5
7
  SHA512:
6
- metadata.gz: 78de64528396d44ad069dc6453f69a080961e01214b8f481b5c3ed93a558e41bd0bc81ed1c00cdb3091686c0cff9c7772999b362a73091322e70ab0100008a87
7
- data.tar.gz: 61ad3b7e336e204b703e7ea7f3a16b6b6a5e11c4d2ccba409f83ad8390bdd4f77fc86db14fdc3f6ae9c62be2a28b7d1dedd686e9a8cf8215e2b29617d48910af
8
+ metadata.gz: !binary |-
9
+ NTk1ZTY4NjExYmQ5NTcwNTllYjIzMmY3YjZlYmRkZGNlMDVlZmU2ZmYzZjkx
10
+ MTQ3MmFlM2ViNTZmMWQ2ZDNkMTYzOWMxZWIyNGY0MWM5N2M1OGVhYmRjMmYw
11
+ N2I1ODVkNzhkMzc5NDU2MDFjZmYzMjJlZTY3MDg5MmQzNmY4ZDA=
12
+ data.tar.gz: !binary |-
13
+ YzkyNzIyMTMyN2NkNWM0NjdjZmIxYjNlY2NlMjFjZjY3ZWU5ODVlOWQzZjMy
14
+ ZjA3YzJhNTQxYTQ5ZTMxZWQ1YmUwZWFkMDgwYjI2MmIxYjNjNDhkYjdlNTc0
15
+ MmU2ZDMzZjEwMTcwMGU0MmE0MWYwMjQ0NDg2NjU2YjNjZTBkMjU=
data/CHANGELOG.markdown CHANGED
@@ -1,3 +1,4 @@
1
+ #### v2.2.5
1
2
  #### v2.2.4
2
3
  #### v2.2.3
3
4
  #### v2.2.5
data/README.md CHANGED
@@ -12,6 +12,9 @@ Version 1 can be found at https://github.com/sportngin/active_zuora_v1
12
12
  ## Thread Safety
13
13
  2.0.X versions of Active Zuora are not thread safe. They depend on a version of [Savon](https://github.com/savonrb/savon) that is [does not work with threads](https://github.com/savonrb/savon/issues/259).
14
14
 
15
+ As of 2.1.0 Active Zuora is now depending on a thread safe version of [Savon](https://github.com/savonrb/savon)
16
+
17
+
15
18
  ## Configuration
16
19
 
17
20
  ```ruby
@@ -182,12 +182,10 @@ module ActiveZuora
182
182
  end
183
183
 
184
184
  customize 'RatePlanCharge' do
185
- exclude_from_queries :rollover_balance
186
- # Can only use overageprice or price or includedunits or
187
- # discountamount or discountpercentage in one query.
188
- # We'll pick price.
185
+ include LazyAttr
189
186
  exclude_from_queries :overage_price, :included_units,
190
- :discount_amount, :discount_percentage
187
+ :discount_amount, :discount_percentage, :rollover_balance, :price
188
+ lazy_load :price
191
189
  end
192
190
 
193
191
  customize 'Refund' do
@@ -16,12 +16,23 @@ module ActiveZuora
16
16
 
17
17
  def fetch_field(field_name)
18
18
  return nil unless self.id
19
- query_string = "select #{self.class.get_field!(field_name).zuora_name} from #{zuora_object_name} where Id = '#{self.id}'"
20
- response = self.class.connection.request(:query){ |soap| soap.body = { :query_string => query_string } }
21
- response[:query_response][:result][:records][field_name.to_sym]
19
+
20
+ records = fetch_field_records("select #{self.class.get_field!(field_name).zuora_name} from #{zuora_object_name} where Id = '#{self.id}'")
21
+ type_cast_fetched_field(field_name, records.nil? ? nil : records[field_name.to_sym])
22
22
  end
23
23
  private :fetch_field
24
24
 
25
+ def fetch_field_records(query_string)
26
+ response = self.class.connection.request(:query){ |soap| soap.body = { :query_string => query_string } }
27
+ response[:query_response][:result][:records]
28
+ end
29
+ private :fetch_field_records
30
+
31
+ def type_cast_fetched_field(field_name, value)
32
+ get_field!(field_name).type_cast(value)
33
+ end
34
+ private :type_cast_fetched_field
35
+
25
36
  module ClassMethods
26
37
  def lazy_load(*field_names)
27
38
  Array(field_names).map(&:to_sym).each do |field_name|
@@ -1,3 +1,3 @@
1
1
  module ActiveZuora
2
- VERSION = "2.2.4"
2
+ VERSION = "2.2.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_zuora
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.4
4
+ version: 2.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ed Lebert
@@ -9,88 +9,88 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-17 00:00:00.000000000 Z
12
+ date: 2015-03-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: savon
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: 1.2.0
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: 1.2.0
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activesupport
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ">="
32
+ - - ! '>='
33
33
  - !ruby/object:Gem::Version
34
34
  version: 3.0.0
35
- - - "<"
35
+ - - <
36
36
  - !ruby/object:Gem::Version
37
37
  version: 5.0.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
41
41
  requirements:
42
- - - ">="
42
+ - - ! '>='
43
43
  - !ruby/object:Gem::Version
44
44
  version: 3.0.0
45
- - - "<"
45
+ - - <
46
46
  - !ruby/object:Gem::Version
47
47
  version: 5.0.0
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: activemodel
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - ! '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.0.0
55
- - - "<"
55
+ - - <
56
56
  - !ruby/object:Gem::Version
57
57
  version: 5.0.0
58
58
  type: :runtime
59
59
  prerelease: false
60
60
  version_requirements: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ">="
62
+ - - ! '>='
63
63
  - !ruby/object:Gem::Version
64
64
  version: 3.0.0
65
- - - "<"
65
+ - - <
66
66
  - !ruby/object:Gem::Version
67
67
  version: 5.0.0
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: rake
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ">="
72
+ - - ! '>='
73
73
  - !ruby/object:Gem::Version
74
74
  version: 0.8.7
75
75
  type: :development
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ">="
79
+ - - ! '>='
80
80
  - !ruby/object:Gem::Version
81
81
  version: 0.8.7
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: rspec
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ">="
86
+ - - ! '>='
87
87
  - !ruby/object:Gem::Version
88
88
  version: 3.0.0
89
89
  type: :development
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
- - - ">="
93
+ - - ! '>='
94
94
  - !ruby/object:Gem::Version
95
95
  version: 3.0.0
96
96
  description: ActiveZuora - Zuora API based on ActiveModel and auto-generated from
@@ -103,10 +103,10 @@ extensions: []
103
103
  extra_rdoc_files:
104
104
  - README.md
105
105
  files:
106
- - ".gitignore"
107
- - ".octopolo.yml"
108
- - ".soyuz.yml"
109
- - ".travis.yml"
106
+ - .gitignore
107
+ - .octopolo.yml
108
+ - .soyuz.yml
109
+ - .travis.yml
110
110
  - CHANGELOG.markdown
111
111
  - Gemfile
112
112
  - MIT-LICENSE
@@ -162,12 +162,12 @@ require_paths:
162
162
  - lib
163
163
  required_ruby_version: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - ">="
165
+ - - ! '>='
166
166
  - !ruby/object:Gem::Version
167
167
  version: '0'
168
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  requirements:
170
- - - ">="
170
+ - - ! '>='
171
171
  - !ruby/object:Gem::Version
172
172
  version: '0'
173
173
  requirements: []