Permalink
Browse files

fixed excluded_query_attributes

  • Loading branch information...
Ed Lebert
Ed Lebert committed Mar 27, 2012
1 parent fe41ebe commit a1211092d1ab313fe1f71d71bbbb857d1e696210
@@ -1,4 +1,7 @@
module Zuora
class Amendment < ZObject
exclude_query_attributes :ratePlanData, :termCommitment
end
end
@@ -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)
@@ -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)
@@ -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)
@@ -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=[])

0 comments on commit a121109

Please sign in to comment.