added auction list to admin panel

This commit is contained in:
olegphenomenon 2022-04-08 18:39:47 +03:00
parent faf87aec7a
commit 2aa1100305
12 changed files with 359 additions and 4 deletions

View file

@ -95,6 +95,7 @@ class Ability
can :manage, User
can :manage, ApiUser
can :manage, AdminUser
can :manage, Auction
can :manage, Certificate
can :manage, LegalDocument
can :manage, BankStatement

View file

@ -12,8 +12,13 @@ class Auction < ApplicationRecord
PENDING_STATUSES = [statuses[:started],
statuses[:awaiting_payment],
statuses[:payment_received]].freeze
private_constant :PENDING_STATUSES
scope :with_status, -> (status) {
where(status: status) if status.present?
}
def self.pending(domain_name)
find_by(domain: domain_name.to_s, status: PENDING_STATUSES)
end