diff --git a/Gemfile b/Gemfile index 2afbbe28..146c5686 100644 --- a/Gemfile +++ b/Gemfile @@ -75,6 +75,7 @@ gem 'mini_magick' gem 'active_attr' gem 'naught' gem 'cancancan' +gem 'sucker_punch' #gem 'geokit' gem 'iso_country_codes' diff --git a/Gemfile.lock b/Gemfile.lock index 5e3a6e86..9f44c152 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -131,6 +131,8 @@ GEM capybara (>= 1.0, < 3) colored launchy + celluloid (0.16.0) + timers (~> 4.0.0) childprocess (0.5.5) ffi (~> 1.0, >= 1.0.11) climate_control (0.0.3) @@ -242,6 +244,7 @@ GEM handlebars-source (1.3.0) hashie (3.4.0) hike (1.2.3) + hitimes (1.2.2) http_parser.rb (0.6.0) i18n (0.7.0) iso_country_codes (0.6.1) @@ -427,6 +430,8 @@ GEM colorize (>= 0.7.0) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) + sucker_punch (1.4.0) + celluloid (~> 0.16.0) temple (0.7.5) test_squad (0.0.1) rails @@ -437,6 +442,8 @@ GEM thor (0.19.1) thread_safe (0.3.4) tilt (1.4.1) + timers (4.0.1) + hitimes tinymce-rails (4.1.6) railties (>= 3.1.1) turnip (1.2.4) @@ -526,6 +533,7 @@ DEPENDENCIES slim-rails spring spring-commands-rspec + sucker_punch test_squad thin turnip diff --git a/app/assets/javascripts/supplier/app/templates/tables/index.emblem b/app/assets/javascripts/supplier/app/templates/tables/index.emblem index 40b997db..2853f431 100644 --- a/app/assets/javascripts/supplier/app/templates/tables/index.emblem +++ b/app/assets/javascripts/supplier/app/templates/tables/index.emblem @@ -25,6 +25,3 @@ can manage tables a.form-action-new.new-table-button{action "newTable"}= t 'table.new_button' = qr-codes-link - a.table-qr-codes{path qr_codes_suppliers_tables} target="_blank" - span.qr-icon - = t 'table.print_qr_codes' diff --git a/app/controllers/contact_forms_controller.rb b/app/controllers/contact_forms_controller.rb index 484283c4..8ec02c2b 100644 --- a/app/controllers/contact_forms_controller.rb +++ b/app/controllers/contact_forms_controller.rb @@ -2,7 +2,7 @@ class ContactFormsController < ApplicationController def create @contact_form = Cmtool::ContactForm.new(contact_form_params) if @contact_form.save - Notifier.contact_form(@contact_form.id).deliver + Notifier.contact_form(@contact_form.id).deliver_later redirect_to root_path, notice: t('contact_form.submitted') else redirect_to go_to_path('contact', locale: I18n.locale), alert: @contact_form.errors.full_messages.join(', ') diff --git a/app/models/supplier.rb b/app/models/supplier.rb index c929839b..012e17b8 100644 --- a/app/models/supplier.rb +++ b/app/models/supplier.rb @@ -185,7 +185,7 @@ class Supplier end def send_creation_notifications - SupplierMailer.creation(self).deliver_now + SupplierMailer.creation(self).deliver_later end private diff --git a/config/initializers/queue.rb b/config/initializers/queue.rb new file mode 100644 index 00000000..7e98127b --- /dev/null +++ b/config/initializers/queue.rb @@ -0,0 +1,3 @@ +Rails.application.configure do + config.active_job.queue_adapter = :sucker_punch +end