Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed excluded_query_attributes

  • Loading branch information...
commit a1211092d1ab313fe1f71d71bbbb857d1e696210 1 parent fe41ebe
Ed Lebert authored
View
3  lib/active_zuora/amendment.rb
@@ -1,4 +1,7 @@
module Zuora
class Amendment < ZObject
+
+ exclude_query_attributes :ratePlanData, :termCommitment
+
end
end
View
5 lib/active_zuora/payment.rb
@@ -1,8 +1,7 @@
module Zuora
class Payment < ZObject
- def self.excluded_query_attributes(attributes=[])
- super([:appliedInvoiceAmount, :invoiceId])
- end
+
+ exclude_query_attributes :appliedInvoiceAmount, :invoiceId
def account
@account ||= Account.find(self.accountId)
View
5 lib/active_zuora/payment_method.rb
@@ -1,8 +1,7 @@
module Zuora
class PaymentMethod < ZObject
- def self.excluded_query_attributes(attributes=[])
- super([:achAccountNumber, :creditCardNumber, :creditCardSecurityCode])
- end
+
+ exclude_query_attributes :achAccountNumber, :creditCardNumber, :creditCardSecurityCode
def account
@account ||= Account.find(self.accountId)
View
5 lib/active_zuora/rate_plan_charge.rb
@@ -1,8 +1,7 @@
module Zuora
class RatePlanCharge < ZObject
- def self.excluded_query_attributes(attributes=[])
- super([:overagePrice, :includedUnits, :discountAmount, :discountPercentage])
- end
+
+ exclude_query_attributes :overagePrice, :includedUnits, :discountAmount, :discountPercentage
def rate_plan
@rate_plan ||= RatePlan.find(self.ratePlanId)
View
15 lib/active_zuora/zobject.rb
@@ -71,13 +71,18 @@ def self.attribute_names
def self.query_attribute_names(options={})
excluded_attributes = []
- excluded_attributes.push *self.excluded_query_attributes unless options[:include_excluded]
- excluded_attributes.push *self.extra_attributes unless options[:include_extras]
- self.attribute_names.reject{|name| excluded_attributes.include? name }
+ excluded_attributes.concat excluded_query_attributes unless options[:include_excluded]
+ excluded_attributes.concat extra_attributes unless options[:include_extras]
+ attribute_names - excluded_attributes
end
- def self.excluded_query_attributes(attributes=[])
- [:fieldsToNull] + attributes
+ def self.exclude_query_attributes(*attributes)
+ @excluded_query_attributes ||= [:fieldsToNull]
+ @excluded_query_attributes.concat attributes
+ end
+
+ def self.excluded_query_attributes
+ @excluded_query_attributes || []
end
def self.extra_attributes(attributes=[])
Please sign in to comment.
Something went wrong with that request. Please try again.