lib/yext/api/administrative_api/account.rb in yext-api-0.1.4 vs lib/yext/api/administrative_api/account.rb in yext-api-0.1.5
- old
+ new
@@ -35,10 +35,10 @@
# The save action only allows the saving of the account_id and the accountName
#
# Furthermore, the account_id cannot be changed by the partner, but only by the customer
# themselves.
def save
- return unless accountId?
+ return unless Yext::Api::Validators::AccountValidator.new(self).valid?
updates = { account_id: account_id, accountName: accountName }
updates[:accountId] = accountId if accountId != account_id
scope.with(Yext::Api::Concerns::AccountChild.with_account_path("")).