diff --git a/Gemfile b/Gemfile index a52da641d..2474103f9 100644 --- a/Gemfile +++ b/Gemfile @@ -88,8 +88,6 @@ end group :development, :test do gem 'pry', '0.10.1' - - gem 'bullet', '4.14.7' # for finding database optimizations gem 'sdoc', '0.4.1' # bundle exec rake doc:rails generates the API under doc/api. gem 'railroady', '1.3.0' # to generate database diagrams gem 'autodoc' diff --git a/Gemfile.lock b/Gemfile.lock index 69d2ba476..957c32618 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -119,9 +119,6 @@ GEM autoprefixer-rails (>= 5.2.1) sassc (>= 2.0.0) builder (3.2.3) - bullet (4.14.7) - activesupport (>= 3.0.0) - uniform_notifier (~> 1.9.0) cancancan (3.0.1) capybara (3.29.0) addressable @@ -393,7 +390,6 @@ GEM unf_ext unf_ext (0.0.7.2) unicode_utils (1.4.0) - uniform_notifier (1.9.0) uuidtools (2.1.5) validates_email_format_of (1.6.3) i18n @@ -429,7 +425,6 @@ DEPENDENCIES airbrake autodoc bootstrap-sass (~> 3.4) - bullet (= 4.14.7) cancancan capybara coderay (= 1.1.0) diff --git a/app/controllers/epp/domains_controller.rb b/app/controllers/epp/domains_controller.rb index 2f31f7e5e..2b708d66c 100644 --- a/app/controllers/epp/domains_controller.rb +++ b/app/controllers/epp/domains_controller.rb @@ -115,8 +115,6 @@ module Epp def delete authorize! :delete, @domain, @password - # all includes for bullet - @domain = Epp::Domain.where(id: @domain.id).includes(nameservers: :versions).first handle_errors(@domain) and return unless @domain.can_be_deleted? diff --git a/app/models/epp/domain.rb b/app/models/epp/domain.rb index 19933a5eb..ae08bcb2e 100644 --- a/app/models/epp/domain.rb +++ b/app/models/epp/domain.rb @@ -23,12 +23,8 @@ class Epp::Domain < Domain active_admins = admin_domain_contacts.select { |x| !x.marked_for_destruction? } active_techs = tech_domain_contacts.select { |x| !x.marked_for_destruction? } - # bullet workaround - ac = active_admins.map { |x| Contact.find(x.contact_id) } - tc = active_techs.map { |x| Contact.find(x.contact_id) } - # validate registrant here as well - ([registrant] + ac + tc).each do |x| + ([registrant] + active_admins + active_techs).each do |x| unless x.valid? add_epp_error('2304', nil, nil, I18n.t(:contact_is_not_valid, value: x.code)) ok = false @@ -123,9 +119,8 @@ class Epp::Domain < Domain def attach_default_contacts return if registrant.blank? - regt = Registrant.find(registrant.id) # temp for bullet - tech_contacts << regt if tech_domain_contacts.blank? - admin_contacts << regt if admin_domain_contacts.blank? && !regt.org? + tech_contacts << registrant if tech_domain_contacts.blank? + admin_contacts << registrant if admin_domain_contacts.blank? && !registrant.org? end def attrs_from(frame, current_user, action = nil) diff --git a/config/environments/development.rb.sample b/config/environments/development.rb.sample index 59efe01d9..f5ed70e06 100644 --- a/config/environments/development.rb.sample +++ b/config/environments/development.rb.sample @@ -32,16 +32,6 @@ Rails.application.configure do config.assets.raise_runtime_errors = true config.action_view.raise_on_missing_translations = true - - # for finding database optimization - config.after_initialize do - Bullet.enable = true - Bullet.bullet_logger = true - Bullet.console = true - Bullet.rails_logger = true - Bullet.add_footer = true - Bullet.unused_eager_loading_enable = false - end end # In this mode, any jobs you queue will be run in the same thread, synchronously diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index a5c1dac93..8e4d28d7a 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -5,7 +5,8 @@ class EppDomainCreateBaseTest < EppTestCase now = Time.zone.parse('2010-07-05') travel_to now name = "new.#{dns_zones(:one).origin}" - registrant = contacts(:john).becomes(Registrant) + contact = contacts(:john) + registrant = contact.becomes(Registrant) request_xml = <<-XML @@ -35,6 +36,8 @@ class EppDomainCreateBaseTest < EppTestCase domain = Domain.find_by(name: name) assert_equal name, domain.name assert_equal registrant, domain.registrant + assert_equal [contact], domain.admin_contacts + assert_equal [contact], domain.tech_contacts assert_not_empty domain.transfer_code default_registration_period = 1.year + 1.day