Skip to content

Commit

Permalink
Merge pull request #198 from rubycentral/add-papertrail
Browse files Browse the repository at this point in the history
Add PaperTrail gem, update gems
  • Loading branch information
barrettclark committed Jul 7, 2020
2 parents 3299929 + a991671 commit dd0ec51
Show file tree
Hide file tree
Showing 19 changed files with 151 additions and 91 deletions.
16 changes: 9 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
ruby '2.6.5'

gem 'rails', '~> 5.2.2'
gem 'rails', '~> 5.2'
gem 'puma'

gem 'pg'
Expand All @@ -24,7 +24,7 @@ gem 'omniauth-twitter'

gem 'chartkick'
gem 'groupdate'
gem 'country_select', '~> 1.3.1'
gem 'country_select', '~> 1.3'
gem 'redcarpet', '~> 3.4'
gem 'coderay', '~> 1.0'
gem 'bootstrap-multiselect-rails', '~> 0.9.9'
Expand All @@ -35,14 +35,16 @@ gem 'responders', '~> 2.4.0'
gem 'pundit'
gem 'faker'
gem 'actionview-encoded_mail_to'
gem 'nokogiri', '~> 1.10.8'
gem 'nokogiri'
gem 'bootsnap', require: false

gem 'webpacker'
gem 'react-rails'

gem 'sidekiq'

gem 'paper_trail'

group :production do
gem 'rails_12factor'
gem 'rack-timeout', '~> 0.5'
Expand All @@ -55,23 +57,23 @@ group :development do
gem 'foreman'
gem 'launchy'
gem 'rack-mini-profiler'
gem 'html2haml', '~> 2.2.0'
gem 'html2haml', '~> 2.2'
gem 'haml-rails'
gem 'spring-commands-rspec', require: false
gem 'web-console'
end

group :development, :test do
gem 'capybara', '~> 2.18.0'
gem 'capybara', '~> 3.33'
gem "selenium-webdriver"
gem 'webdrivers', '~> 4.0'
gem 'database_cleaner', '~> 1.6.0'
gem 'database_cleaner', '~> 1.6'
gem 'dotenv-rails'
gem "factory_bot_rails"
gem 'growl'
gem 'guard'
gem 'guard-rspec'
gem 'guard-livereload', '~> 2.1.1'
gem 'guard-livereload', '~> 2.1'
gem 'rspec'
gem 'rspec-rails'
gem 'rails-controller-testing'
Expand Down
96 changes: 50 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ GEM
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 14.0)
arel (9.0.0)
autoprefixer-rails (9.7.6)
autoprefixer-rails (9.8.4)
execjs
babel-source (5.8.35)
babel-transpiler (0.7.0)
Expand All @@ -82,35 +82,36 @@ GEM
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
builder (3.2.4)
capybara (2.18.0)
capybara (3.33.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (>= 2.0, < 4.0)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
case_transform (0.2)
activesupport
chartkick (3.3.1)
childprocess (3.0.0)
coderay (1.1.2)
coderay (1.1.3)
concurrent-ruby (1.1.6)
connection_pool (2.2.2)
connection_pool (2.2.3)
countries (0.9.3)
currencies (~> 0.4.2)
country_select (1.3.1)
countries (= 0.9.3)
crass (1.0.6)
currencies (0.4.2)
database_cleaner (1.6.2)
database_cleaner (1.8.5)
debug_inspector (0.0.3)
devise (4.7.1)
devise (4.7.2)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.3)
diff-lcs (1.4.4)
dotenv (2.7.5)
dotenv-rails (2.7.5)
dotenv (= 2.7.5)
Expand All @@ -128,16 +129,16 @@ GEM
erubis (2.7.0)
eventmachine (1.2.7)
execjs (2.7.0)
factory_bot (5.2.0)
activesupport (>= 4.2.0)
factory_bot_rails (5.2.0)
factory_bot (~> 5.2.0)
railties (>= 4.2.0)
faker (2.11.0)
factory_bot (6.0.2)
activesupport (>= 5.0.0)
factory_bot_rails (6.0.0)
factory_bot (~> 6.0.0)
railties (>= 5.0.0)
faker (2.13.0)
i18n (>= 1.6, < 2)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.12.2)
ffi (1.13.1)
foreman (0.87.1)
formatador (0.2.5)
globalid (0.4.2)
Expand All @@ -155,9 +156,10 @@ GEM
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-livereload (2.1.3)
guard-livereload (2.5.2)
em-websocket (~> 0.5)
guard (~> 2.0)
guard (~> 2.8)
guard-compat (~> 1.0)
multi_json (~> 1.8)
guard-rspec (4.7.3)
guard (~> 2.1)
Expand All @@ -179,7 +181,7 @@ GEM
nokogiri (>= 1.6.0)
ruby_parser (~> 3.5)
http_parser.rb (0.6.0)
i18n (1.8.2)
i18n (1.8.3)
concurrent-ruby (~> 1.0)
interception (0.5)
jbuilder (2.10.0)
Expand All @@ -202,10 +204,10 @@ GEM
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.5.0)
loofah (2.6.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.4)
lumberjack (1.2.6)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
Expand Down Expand Up @@ -249,6 +251,9 @@ GEM
omniauth-oauth (~> 1.1)
rack
orm_adapter (0.5.0)
paper_trail (10.3.1)
activerecord (>= 4.2)
request_store (~> 1.1)
pg (1.2.3)
pry (0.13.1)
coderay (~> 1.1)
Expand All @@ -258,7 +263,7 @@ GEM
pry-remote (0.1.8)
pry (~> 0.9)
slop (~> 3.0)
pry-rescue (1.5.0)
pry-rescue (1.5.2)
interception (>= 0.5)
pry (>= 0.12.0)
public_suffix (4.0.5)
Expand All @@ -267,10 +272,8 @@ GEM
pundit (2.1.0)
activesupport (>= 3.0.0)
rack (2.2.3)
rack-mini-profiler (2.0.1)
rack-mini-profiler (2.0.2)
rack (>= 1.2.0)
rack-protection (2.0.8.1)
rack
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
Expand All @@ -290,10 +293,10 @@ GEM
railties (= 5.2.4.3)
sprockets-rails (>= 2.0.0)
rails-assets-momentjs (2.22.2)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
actionview (>= 5.0.1.x)
activesupport (>= 5.0.1.x)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand Down Expand Up @@ -321,7 +324,8 @@ GEM
railties (>= 3.2)
tilt
redcarpet (3.5.0)
redis (4.1.4)
redis (4.2.1)
regexp_parser (1.7.1)
request_store (1.5.0)
rack (>= 1.4)
responders (2.4.1)
Expand Down Expand Up @@ -353,7 +357,7 @@ GEM
rubyzip (2.3.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.3.0)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
Expand All @@ -366,21 +370,20 @@ GEM
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
semantic_range (2.3.0)
sexp_processor (4.14.1)
sexp_processor (4.15.0)
shellany (0.0.1)
sidekiq (6.0.7)
sidekiq (6.1.0)
connection_pool (>= 2.2.2)
rack (~> 2.0)
rack-protection (>= 2.0.0)
redis (>= 4.1.0)
redis (>= 4.2.0)
simple_form (5.0.2)
actionpack (>= 5.0)
activemodel (>= 5.0)
slop (3.6.0)
spring (2.1.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (4.0.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
Expand All @@ -404,7 +407,7 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webdrivers (4.3.0)
webdrivers (4.4.1)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0, < 4.0)
Expand All @@ -431,11 +434,11 @@ DEPENDENCIES
bootsnap
bootstrap-multiselect-rails (~> 0.9.9)
bootstrap-sass (~> 3.4.1)
capybara (~> 2.18.0)
capybara (~> 3.33)
chartkick
coderay (~> 1.0)
country_select (~> 1.3.1)
database_cleaner (~> 1.6.0)
country_select (~> 1.3)
database_cleaner (~> 1.6)
devise (~> 4.7)
dotenv-rails
draper (~> 3.0.1)
Expand All @@ -445,19 +448,20 @@ DEPENDENCIES
groupdate
growl
guard
guard-livereload (~> 2.1.1)
guard-livereload (~> 2.1)
guard-rspec
haml (~> 5.0.0)
haml-rails
html2haml (~> 2.2.0)
html2haml (~> 2.2)
jbuilder
jquery-datatables-rails
jquery-rails
jquery-ui-rails
launchy
nokogiri (~> 1.10.8)
nokogiri
omniauth-github
omniauth-twitter
paper_trail
pg
pry-rails
pry-remote
Expand All @@ -466,7 +470,7 @@ DEPENDENCIES
pundit
rack-mini-profiler
rack-timeout (~> 0.5)
rails (~> 5.2.2)
rails (~> 5.2)
rails-assets-momentjs!
rails-controller-testing
rails_12factor
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ class ApplicationController < ActionController::Base
include Pundit
include ActivateNavigation
rescue_from Pundit::NotAuthorizedError, with: :user_not_authorized
#after_action :verify_authorized, except: :index
#after_action :verify_policy_scoped, only: :index

require "csv"
# Prevent CSRF attacks by raising an exception.
Expand All @@ -18,6 +16,7 @@ class ApplicationController < ActionController::Base
helper_method :schedule_mode?
helper_method :program_tracks

before_action :set_paper_trail_whodunnit
before_action :current_event
before_action :configure_permitted_parameters, if: :devise_controller?

Expand Down
6 changes: 6 additions & 0 deletions app/models/proposal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class Proposal < ApplicationRecord
serialize :last_change
serialize :proposal_data, Hash

has_paper_trail only: [:title, :abstract, :details, :pitch]

attr_accessor :tags, :review_tags, :updating_user

accepts_nested_attributes_for :public_comments, reject_if: Proc.new { |comment_attributes| comment_attributes[:body].blank? }
Expand Down Expand Up @@ -249,6 +251,10 @@ def has_reviewer_activity?
ratings.present? || has_reviewer_comments?
end

def changeset_fields
versions[1..]&.map(&:changeset)&.flat_map(&:keys)&.uniq
end

private

def abstract_length
Expand Down
Loading

0 comments on commit dd0ec51

Please sign in to comment.