lib/geo_certs/order.rb in geocerts-0.0.15 vs lib/geo_certs/order.rb in geocerts-0.0.16

- old
+ new

@@ -27,19 +27,18 @@ :years attr_reader :administrator, :csr, :ev_approver, :organization, - :pending_audit, - :product, + :flagged, :renewal, :renewal_information, :trial alias :approver= :approver_email= - force_boolean :pending_audit, + force_boolean :flagged, :renewal, :trial ## # Returns all orders within the requested date range. By default the server will @@ -282,10 +281,16 @@ @product = case input when Product input when String Product.find(input) + when Hash + @_product_id = input[:sku] if input[:sku]; nil end + end + + def product + @product ||= @_product_id ? Product.find(@_product_id) : nil end ## # Sets the extended validation approver for the order. This method # accepts either a GeoCerts::ExtendedValidationApprover instance or a