diff --git a/Gemfile.lock b/Gemfile.lock index 113fefa558..52ac7f0f3f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -212,7 +212,7 @@ GEM hoptoad_notifier (2.4.11) activesupport builder - htmlentities (4.3.1) + htmlentities (4.3.4) http-cookie (1.0.2) domain_name (~> 0.5) i18n (0.7.0) @@ -254,7 +254,7 @@ GEM rake mini_magick (4.5.1) mini_portile2 (2.0.0) - minitest (5.8.4) + minitest (5.9.0) momentjs-rails (2.8.1) railties (>= 3.1) monetize (1.4.0) @@ -302,9 +302,10 @@ GEM rack-openid (~> 1.3.1) open4 (1.3.4) orm_adapter (0.5.0) - paper_trail (3.0.1) - activerecord (>= 3.0, < 5.0) - activesupport (>= 3.0, < 5.0) + paper_trail (5.0.1) + activerecord (>= 3.0, < 6.0) + activesupport (>= 3.0, < 6.0) + request_store (~> 1.1) parser (2.3.0.3) ast (~> 2.2) pdf-core (0.2.5) @@ -402,7 +403,7 @@ GEM yajl-ruby (~> 1.1) redcarpet (3.2.3) referer-parser (0.2.1) - request_store (1.0.6) + request_store (1.1.0) responders (2.1.1) railties (>= 4.2.0, < 5.1) rest-client (1.8.0) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 51dc677248..8fdc2a0d44 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,4 +1,5 @@ class ApplicationController < ActionController::Base + before_filter :set_paper_trail_whodunnit include ApplicationHelper add_flash_types :error protect_from_forgery with: :exception diff --git a/app/views/conference_registrations/_questions.html.haml b/app/views/conference_registrations/_questions.html.haml index 56ee7836e9..dcb9b3081c 100644 --- a/app/views/conference_registrations/_questions.html.haml +++ b/app/views/conference_registrations/_questions.html.haml @@ -1,8 +1,7 @@ = f.inputs 'Additional Info' do - @conference.questions.each do |q| - if q.question_type.id == 1 || q.question_type.id == 2 # yes/no or single choice - = f.input :qanswers, :collection => q.qanswers, :as => :select, :input_html => { :multiple => false }, label: q.title, :include_blank => "Please make your choice", - :member_label => Proc.new {|a| a.answer.title} + = f.input :qanswers, :collection => q.qanswers.joins(:answer).pluck("answers.title, qanswers.id"), :as => :select, :input_html => { :multiple => false }, + label: q.title, :include_blank => "Please make your choice" - if q.question_type.id == 3 # multiple choice - = f.input :qanswers, :collection => q.qanswers, :as => :check_boxes, label: q.title, - :member_label => Proc.new {|a| a.answer.title} + = f.input :qanswers, :collection => q.qanswers.joins(:answer).pluck("answers.title, qanswers.id"), :as => :check_boxes, label: q.title diff --git a/config/initializers/paper_trail.rb b/config/initializers/paper_trail.rb new file mode 100644 index 0000000000..77a8364d6f --- /dev/null +++ b/config/initializers/paper_trail.rb @@ -0,0 +1,2 @@ +# Tracking associations is an experimental feature and it is recommended to set it to false +PaperTrail.config.track_associations = false