mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
Complete auction integration
This commit is contained in:
parent
f1148bd4f4
commit
446b9fbf77
6 changed files with 62 additions and 6 deletions
|
@ -6,6 +6,7 @@ class Auction < ActiveRecord::Base
|
|||
payment_received: 'payment_received',
|
||||
payment_not_received: 'payment_not_received',
|
||||
domain_registered: 'domain_registered',
|
||||
domain_not_registered: 'domain_not_registered',
|
||||
}
|
||||
|
||||
PENDING_STATUSES = [statuses[:started],
|
||||
|
@ -43,6 +44,15 @@ class Auction < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
|
||||
def mark_as_domain_not_registered
|
||||
self.status = self.class.statuses[:domain_not_registered]
|
||||
|
||||
transaction do
|
||||
save!
|
||||
restart
|
||||
end
|
||||
end
|
||||
|
||||
def domain_registrable?(registration_code = nil)
|
||||
payment_received? && registration_code_matches?(registration_code)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue