module NameEntity::PermitAlterations

Public Instance Methods

valid_for_create?() click to toggle source
# File lib/quickbooks/util/name_entity.rb, line 74
def valid_for_create?
  valid?
  errors.empty?
end
valid_for_deletion?() click to toggle source

To delete an account Intuit requires we provide Id and SyncToken fields

# File lib/quickbooks/util/name_entity.rb, line 80
def valid_for_deletion?
  return false if(id.nil? || sync_token.nil?)
  id.to_i > 0 && !sync_token.to_s.empty? && sync_token.to_i >= 0
end
valid_for_update?() click to toggle source
# File lib/quickbooks/util/name_entity.rb, line 67
def valid_for_update?
  if sync_token.nil?
    errors.add(:sync_token, "Missing required attribute SyncToken for update")
  end
  errors.empty?
end