Class: Bullion::Models::Order

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/bullion/models/order.rb

Overview

ACMEv2 Order model

Instance Method Summary collapse

Instance Method Details

#certificateObject



34
35
36
# File 'lib/bullion/models/order.rb', line 34

def certificate
  Certificate.find(certificate_id)
end

#init_valuesObject



16
17
18
19
20
# File 'lib/bullion/models/order.rb', line 16

def init_values
  self.expires ||= Time.now + (60 * 60)
  self.not_before ||= Time.now
  self.not_after ||= Time.now + (60 * 60 * 24 * 90) # 90 days
end

#prep_authorizations!Object



22
23
24
25
26
27
28
29
30
31
32
# File 'lib/bullion/models/order.rb', line 22

def prep_authorizations!
  identifiers.each do |identifier|
    authorization = Authorization.new
    authorization.order = self
    authorization.identifier = identifier

    authorization.save

    authorization.prep_challenges!
  end
end