active_zuora 1.5.1 → 1.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MWMwY2FhMTkzNmU3ZmYyNWJiYTEyMTM1Yjk1M2FmNjdhOWRjMjJlYg==
5
- data.tar.gz: !binary |-
6
- NzdlYTQ5ZTQ0ODEwYzM2MzY4NDU2MzI0Njk1Nzk2NjE2N2MxOTg3Nw==
2
+ SHA1:
3
+ metadata.gz: 48fa94eebb46aca23ca17fba08d0e4db65c5164b
4
+ data.tar.gz: e0f7124c72db2e7f9845c208b3a93931bde16026
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- MGYyOTcxY2IyOTI3N2MwMDM4ZGEzMzBhZWEyZjJkNTJhMDc0Y2RkZGE3MWY1
10
- NmU1YWUzMzQ3YjBiZTJhZjZkZjk2OGZkYjc4ODU1ZTM2OGIwNDQzOWI1NWQw
11
- MGYyODM3NjI0NzkzZDg4OTlmMzVmNjJhYWY1OGI0ZmIyOWEwNjg=
12
- data.tar.gz: !binary |-
13
- NWQxMzY4YTA4M2Q2YTVmOTQ4OTNiNDdiMDhhNTI1NTA5MTI4YTAyZDk3MDZj
14
- NWZkYjFmMmRkN2EzODRjODA3YzM5M2Y3NTJjM2ZlOWE0MjQ2MjNkYTI2OGVk
15
- NGQ5ZDk3MGM3YzZmZTViZDkyMjc3OGEwNDliODE0MGNhNTFmZmU=
6
+ metadata.gz: b1a31cf4927f8c8393753d933320ad10dad7e2f4a6ce97912f2214048f1de2a4f54afeb9f1a4d36612724aa10e7c6dc75467872e854cbc8e9d19aea5cecca891
7
+ data.tar.gz: 1794c90f7e827135c6b9c606c2e39838c087c2b12744cc6e75f44b5fab2c257e4fa54020eab55eb7dce60e8f679fd5c8012a742ddfe079bf49926204acc7f894
@@ -6,7 +6,7 @@
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "active_zuora"
9
- s.version = "1.5.1"
9
+ s.version = "1.5.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
@@ -16,6 +16,10 @@ module Zuora
16
16
  @invoices ||= Invoice.where(:accountid => self.id)
17
17
  end
18
18
 
19
+ def invoices_with_balance
20
+ @invoices_with_balance ||= Invoice.where("accountId = '#{self.id}' AND Balance > 0")
21
+ end
22
+
19
23
  def payment_methods
20
24
  @payment_methods ||= PaymentMethod.where(:accountid => self.id)
21
25
  end
@@ -110,7 +110,7 @@ module Zuora
110
110
 
111
111
  def self.where(conditions={}, options={})
112
112
  # You can give a hash or a string for the conditions
113
- conditions = build_filter_statments(conditions) if conditions.is_a? Hash
113
+ conditions = build_filter_statments(conditions)
114
114
  query = "select #{self.query_attribute_names(options).join(", ")} from #{self.name.gsub(/Zuora::/,"")} where #{conditions}"
115
115
  puts query if $DEBUG
116
116
  zobjects = self.client.query(query)
@@ -118,11 +118,15 @@ module Zuora
118
118
  end
119
119
 
120
120
  def self.build_filter_statments(filter_statments)
121
- filter_statments.map{|key, value|
122
- value = "'#{value}'" if value.kind_of?(String)
123
- value = "null" if value.nil?
124
- "#{key} = #{value}"
125
- }.join(" and ")
121
+ if filter_statments.is_a?(Hash)
122
+ filter_statments.map{|key, value|
123
+ value = "'#{value}'" if value.kind_of?(String)
124
+ value = "null" if value.nil?
125
+ "#{key} = #{value}"
126
+ }.join(" and ")
127
+ else
128
+ filter_statments
129
+ end
126
130
  end
127
131
 
128
132
  def self.find(id)
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: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Fleener
@@ -16,42 +16,42 @@ dependencies:
16
16
  name: soap4r-ng
17
17
  requirement: !ruby/object:Gem::Requirement
18
18
  requirements:
19
- - - ! '>='
19
+ - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
- - - ! '>='
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
28
  version: '0'
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: rake
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - ! '>='
33
+ - - ">="
34
34
  - !ruby/object:Gem::Version
35
35
  version: '0'
36
36
  type: :development
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - ! '>='
40
+ - - ">="
41
41
  - !ruby/object:Gem::Version
42
42
  version: '0'
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: test-unit
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - ! '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
50
  type: :development
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
- - - ! '>='
54
+ - - ">="
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  description: A client for Zuora API
@@ -114,12 +114,12 @@ require_paths:
114
114
  - lib
115
115
  required_ruby_version: !ruby/object:Gem::Requirement
116
116
  requirements:
117
- - - ! '>='
117
+ - - ">="
118
118
  - !ruby/object:Gem::Version
119
119
  version: '0'
120
120
  required_rubygems_version: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>='
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  requirements: