From c00b04e9e81be8146c1e2549afa4789cbda15677 Mon Sep 17 00:00:00 2001 From: Nishanth Vijayan Date: Mon, 16 May 2016 01:20:53 +0530 Subject: [PATCH 1/3] Update htmlentities gem to remove duplicated key warning --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index ef102920c0..7bdf62ea20 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) From 13f0f9703d295745e7848d2c6b9d1fd892498316 Mon Sep 17 00:00:00 2001 From: Nishanth Vijayan Date: Tue, 17 May 2016 18:17:04 +0530 Subject: [PATCH 2/3] Replace usage of deprecated member_label option in forms with Array of label/value pairs --- app/views/conference_registrations/_questions.html.haml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 From d152b5eddc3392e8c63a17efc65697592e61901c Mon Sep 17 00:00:00 2001 From: Nishanth Vijayan Date: Wed, 18 May 2016 20:17:35 +0530 Subject: [PATCH 3/3] Update paper_trail gem to latest --- Gemfile.lock | 11 ++++++----- app/controllers/application_controller.rb | 1 + config/initializers/paper_trail.rb | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 config/initializers/paper_trail.rb diff --git a/Gemfile.lock b/Gemfile.lock index 7bdf62ea20..89c4c9e6f9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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/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