Skip to content

Commit

Permalink
Merge pull request #2706 from TracksApp/update_rails
Browse files Browse the repository at this point in the history
Update Rails to last 6.1
  • Loading branch information
ZeiP committed Jun 6, 2024
2 parents 9e66242 + a94d4fa commit 063c8bd
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 573 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gem 'coffee-rails', '~> 5.0.0'
gem 'jquery-rails', '~> 4.6'
gem 'jquery-ui-rails', '~>6.0.1'

gem 'rails', '~> 6.0.0'
gem 'rails', '~> 6.1'
gem 'sassc-rails', '~> 2.1.2'

gem 'bootstrap-sass', '3.4.1'
Expand Down
152 changes: 78 additions & 74 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,70 +4,75 @@ GEM
RedCloth (4.3.3)
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (6.0.6.1)
actionpack (= 6.0.6.1)
actioncable (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.6.1)
actionpack (= 6.0.6.1)
activejob (= 6.0.6.1)
activerecord (= 6.0.6.1)
activestorage (= 6.0.6.1)
activesupport (= 6.0.6.1)
actionmailbox (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
mail (>= 2.7.1)
actionmailer (6.0.6.1)
actionpack (= 6.0.6.1)
actionview (= 6.0.6.1)
activejob (= 6.0.6.1)
actionmailer (6.1.7.8)
actionpack (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activesupport (= 6.1.7.8)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.6.1)
actionview (= 6.0.6.1)
activesupport (= 6.0.6.1)
rack (~> 2.0, >= 2.0.8)
actionpack (6.1.7.8)
actionview (= 6.1.7.8)
activesupport (= 6.1.7.8)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionpack-xml_parser (2.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
actiontext (6.0.6.1)
actionpack (= 6.0.6.1)
activerecord (= 6.0.6.1)
activestorage (= 6.0.6.1)
activesupport (= 6.0.6.1)
actiontext (6.1.7.8)
actionpack (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
nokogiri (>= 1.8.5)
actionview (6.0.6.1)
activesupport (= 6.0.6.1)
actionview (6.1.7.8)
activesupport (= 6.1.7.8)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.6.1)
activesupport (= 6.0.6.1)
activejob (6.1.7.8)
activesupport (= 6.1.7.8)
globalid (>= 0.3.6)
activemodel (6.0.6.1)
activesupport (= 6.0.6.1)
activemodel (6.1.7.8)
activesupport (= 6.1.7.8)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (6.0.6.1)
activemodel (= 6.0.6.1)
activesupport (= 6.0.6.1)
activestorage (6.0.6.1)
actionpack (= 6.0.6.1)
activejob (= 6.0.6.1)
activerecord (= 6.0.6.1)
activerecord (6.1.7.8)
activemodel (= 6.1.7.8)
activesupport (= 6.1.7.8)
activestorage (6.1.7.8)
actionpack (= 6.1.7.8)
activejob (= 6.1.7.8)
activerecord (= 6.1.7.8)
activesupport (= 6.1.7.8)
marcel (~> 1.0)
activesupport (6.0.6.1)
mini_mime (>= 1.1.0)
activesupport (6.1.7.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
acts_as_list (1.1.0)
activerecord (>= 4.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
acts_as_list (1.2.1)
activerecord (>= 6.1)
activesupport (>= 6.1)
ast (2.4.2)
autoprefixer-rails (10.4.7.0)
execjs (~> 2)
Expand Down Expand Up @@ -102,7 +107,7 @@ GEM
concurrent-ruby (1.3.1)
crass (1.0.6)
database_cleaner (1.99.0)
date (3.3.3)
date (3.3.4)
diff-lcs (1.5.0)
docile (1.1.5)
e2mmap (0.1.0)
Expand All @@ -116,8 +121,8 @@ GEM
ffi (1.16.3)
font-awesome-sass (6.5.1)
sassc (~> 2.0)
globalid (1.1.0)
activesupport (>= 5.0)
globalid (1.2.1)
activesupport (>= 6.1)
highline (2.1.0)
htmlentities (4.3.4)
i18n (1.14.5)
Expand Down Expand Up @@ -169,21 +174,21 @@ GEM
mime-types (3.4.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.0218.1)
mini_mime (1.1.2)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
minitest (5.23.1)
minitest-stub-const (0.6)
mocha (2.1.0)
ruby2_keywords (>= 0.0.5)
mysql2 (0.5.5)
net-imap (0.3.6)
net-imap (0.4.12)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.1)
net-protocol (0.2.2)
timeout
net-smtp (0.3.3)
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.15.5)
Expand All @@ -202,20 +207,20 @@ GEM
rack (>= 1.2.0)
rack-test (2.1.0)
rack (>= 1.3)
rails (6.0.6.1)
actioncable (= 6.0.6.1)
actionmailbox (= 6.0.6.1)
actionmailer (= 6.0.6.1)
actionpack (= 6.0.6.1)
actiontext (= 6.0.6.1)
actionview (= 6.0.6.1)
activejob (= 6.0.6.1)
activemodel (= 6.0.6.1)
activerecord (= 6.0.6.1)
activestorage (= 6.0.6.1)
activesupport (= 6.0.6.1)
bundler (>= 1.3.0)
railties (= 6.0.6.1)
rails (6.1.7.8)
actioncable (= 6.1.7.8)
actionmailbox (= 6.1.7.8)
actionmailer (= 6.1.7.8)
actionpack (= 6.1.7.8)
actiontext (= 6.1.7.8)
actionview (= 6.1.7.8)
activejob (= 6.1.7.8)
activemodel (= 6.1.7.8)
activerecord (= 6.1.7.8)
activestorage (= 6.1.7.8)
activesupport (= 6.1.7.8)
bundler (>= 1.15.0)
railties (= 6.1.7.8)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -235,12 +240,12 @@ GEM
actionview (> 3.1)
activesupport (> 3.1)
railties (> 3.1)
railties (6.0.6.1)
actionpack (= 6.0.6.1)
activesupport (= 6.0.6.1)
railties (6.1.7.8)
actionpack (= 6.1.7.8)
activesupport (= 6.1.7.8)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (>= 12.2)
thor (~> 1.0)
rainbow (3.1.1)
rake (13.1.0)
rb-fsevent (0.11.2)
Expand Down Expand Up @@ -325,22 +330,21 @@ GEM
libv8 (~> 3.16.14.15)
ref
thor (1.3.0)
thread_safe (0.3.6)
tilt (2.3.0)
timeout (0.3.2)
timeout (0.4.1)
tolk (5.0.1)
rails (>= 6.0)
safe_yaml (>= 0.8.6)
sprockets-rails (~> 3.4)
tracks-chartjs-ror (3.6.4)
rails (>= 3.1)
tzinfo (1.2.11)
thread_safe (~> 0.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
unicode-display_width (2.5.0)
uniform_notifier (1.16.0)
websocket-driver (0.7.5)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (4.0.0)
Expand Down Expand Up @@ -377,7 +381,7 @@ DEPENDENCIES
pg (~> 1.5.4)
puma (~> 6.4)
rack-mini-profiler
rails (~> 6.0.0)
rails (~> 6.1)
rails-controller-testing
rails-dom-testing (~> 2.2.0)
rails_autolink
Expand All @@ -397,4 +401,4 @@ DEPENDENCIES
yard

BUNDLED WITH
2.2.33
2.4.19
2 changes: 1 addition & 1 deletion app/controllers/contexts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def create
end
format.xml do
if @context.new_record?
render_failure @context.errors.to_xml.html_safe, 409
render_failure @context.errors.full_messages.to_xml(root: "errors", skip_types: true).html_safe, 409
else
head :created, :location => context_url(@context)
end
Expand Down
26 changes: 1 addition & 25 deletions app/controllers/integrations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
class IntegrationsController < ApplicationController
require 'mail'

skip_before_action :login_required, :only => [:cloudmailin, :search_plugin]
skip_before_action :verify_authenticity_token, only: [:cloudmailin]
skip_before_action :login_required, :only => [:search_plugin]

def index
@page_title = 'TRACKS::Integrations'
Expand All @@ -21,31 +20,8 @@ def search_plugin
.pack('m').gsub(/\n/, '')
end

def cloudmailin
if !verify_cloudmailin_signature
render :body => "Message signature verification failed.", :status => 403
return false
end

if process_message(params[:message])
render :body => 'success', :status => 200
else
render :body => "No user found or other error", :status => 404
end
end

private

def process_message(message)
MessageGateway.receive(Mail.new(message))
end

def verify_cloudmailin_signature
provided = request.request_parameters.delete(:signature)
signature = Digest::MD5.hexdigest(flatten_params(request.request_parameters).sort.map { |k, v| v }.join + SITE_CONFIG['cloudmailin'])
return provided == signature
end

def flatten_params(params, title = nil, result = {})
params.each do |key, value|
if value.is_a? Hash
Expand Down
36 changes: 0 additions & 36 deletions app/controllers/mailgun_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/controllers/projects_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def create
end
format.xml do
if @project.new_record?
render_failure @project.errors.to_xml.html_safe, 409
render_failure @project.errors.full_messages.to_xml(root: "errors", skip_types: true).html_safe, 409
else
head :created, :location => project_url(@project), :text => @project.id
end
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/todos_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def create
if @saved
head :created, :location => todo_url(@todo)
else
render_failure @todo.errors.to_xml.html_safe, 409
render_failure @todo.errors.full_messages.to_xml(root: "errors", skip_types: true).html_safe, 409
end
end
end
Expand Down Expand Up @@ -438,7 +438,7 @@ def update
rescue ActiveRecord::RecordInvalid => exception
record = exception.record
if record.is_a?(Dependency)
record.errors.each { |key, value| @todo.errors[key] << value }
record.errors.each { |key, value| @todo.errors.add(key, value) }
end
@saved = false
end
Expand Down Expand Up @@ -1192,7 +1192,7 @@ def parse_date_for_update(date, error_msg)
begin
parse_date_per_user_prefs(date)
rescue
@todo.errors[:base] << error_msg
@todo.errors.add(:base, error_msg)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def create
unless user.new_record?
render :body => t('users.user_created'), :status => 200
else
render_failure user.errors.to_xml, 409
render_failure user.errors.full_messages.to_xml(root: "errors", skip_types: true), 409
end
return
end
Expand Down
Loading

0 comments on commit 063c8bd

Please sign in to comment.