Add multiple checkboxes to select domains for bulk renew

This commit is contained in:
Alex Sherman 2020-12-10 14:35:04 +05:00
parent 9c662471a7
commit 40b22cd433
3 changed files with 28 additions and 0 deletions

View file

@ -11,6 +11,8 @@ class Registrar
def bulk_renew
authorize! :manage, :repp
@expire_date = params[:expire_date].to_date
# binding.pry
@domains = domains_by_date(@expire_date)
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
end
@ -23,5 +25,13 @@ class Registrar
def default_tab
:technical_contact
end
def domains_scope
current_registrar_user.registrar.domains
end
def domains_by_date(date)
domains_scope.where('valid_to <= ?', date)
end
end
end