mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
18 lines
677 B
Ruby
18 lines
677 B
Ruby
class Admin::DomainVersionsController < AdminController
|
|
load_and_authorize_resource
|
|
|
|
# rubocop:disable Style/GuardClause
|
|
def index
|
|
@domain = Domain.where(id: params[:domain_id]).includes({versions: :item}).first
|
|
@versions = @domain.versions
|
|
|
|
if @domain.pending_json.present?
|
|
frame = Nokogiri::XML(@domain.pending_json['frame'])
|
|
@pending_user = User.find(@domain.pending_json['current_user_id'])
|
|
@pending_domain = Epp::Domain.find(@domain.id)
|
|
@pending_domain.updated_at = @domain.pending_json['domain']['updated_at'].last
|
|
@pending_domain.update(frame, @pending_user, false)
|
|
end
|
|
end
|
|
# rubocop:enable Style/GuardClause
|
|
end
|