lib/geo_certs/order.rb in geocerts-0.0.23 vs lib/geo_certs/order.rb in geocerts-0.0.24
- old
+ new
@@ -194,11 +194,11 @@
parameters[:years] = self.years
parameters[:licenses] = self.licenses
parameters[:sans] = GeoCerts.escape(self.sans) if self.sans
parameters.merge!(self.csr.to_geocerts_hash) if self.csr
parameters.merge!(self.product.to_geocerts_hash) if self.product
-
+
update_attributes(self.class.call_api {GeoCerts.api.validate_order(parameters)[:order]})
rescue GeoCerts::AllowableExceptionWithResponse
store_exception_errors_and_warnings($!)
false
end
@@ -234,11 +234,11 @@
##
# Returns +true+ if the Order has not been saved.
#
def new_record?
- self.id.nil?
+ self.id.nil? || self.id == ''
end
##
# Sets the CSR for the order. You can either pass a GeoCerts::CSR object, or
# the body of a CSR.
@@ -369,10 +369,10 @@
parameters.merge!(self.csr.to_geocerts_hash) if self.csr
parameters.merge!(self.product.to_geocerts_hash) if self.product
parameters.merge!(self.ev_approver.to_geocerts_hash) if self.ev_approver
parameters.merge!(self.administrator.to_geocerts_hash) if self.administrator
parameters.merge!(self.organization.to_geocerts_hash) if self.organization
-
+
update_attributes(self.class.call_api {GeoCerts.api.create_order(parameters)[:order]})
self
rescue GeoCerts::AllowableExceptionWithResponse
store_exception_errors_and_warnings($!)
self