Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 6 #936

Merged
merged 17 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['2.6'] # , '2.7', '3.0'
ruby-version: ['2.7'] # , '2.7', '3.0'

steps:
- uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ settings.yml - Background, foreground colors for tasks, accounts, opportunities,

Refactoring to Bootstrap for forms, buttons, layouts.

Drop ruby 2.5 support

Upgrade to rails 6, papertail 12, devise 4.8

Wed May 09, 2021 (0.19.2)
======
CVE-2021-22885
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source 'https://rubygems.org'

case ENV['CI'] && ENV['DB']
when 'sqlite'
gem 'sqlite3', '~> 1.3.13'
gem 'sqlite3', '~> 1.4.0'
when 'mysql'
gem 'mysql2'
when 'postgres'
Expand Down Expand Up @@ -78,14 +78,15 @@ group :test do
gem 'database_cleaner'
gem 'zeus', platform: :ruby unless ENV["CI"]
gem 'timecop'
gem 'sqlite3', '~> 1.3.13'
gem 'sqlite3', '~> 1.4.0'
end

group :heroku do
gem 'rails_12factor'
gem 'puma'
end

gem 'responds_to_parent', git: 'https://github.com/CloCkWeRX/responds_to_parent.git', branch: 'patch-1' # Temporarily pointed at git until https://github.com/zendesk/responds_to_parent/pull/6 is released
gem 'sass-rails', '~> 5.0.3' # sass-rails 6 requires GCC 4.5+
gem 'coffee-rails'
gem 'uglifier'
Expand Down
120 changes: 71 additions & 49 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,51 +1,73 @@
GIT
remote: https://github.com/CloCkWeRX/responds_to_parent.git
revision: fc42ea13be78b065a7975564b1828d6feaef8660
branch: patch-1
specs:
responds_to_parent (2.0.0)
actionpack (>= 3.2.22, < 6.1)

GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.6)
actionpack (= 5.2.6)
actioncable (6.0.3.7)
actionpack (= 6.0.3.7)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
actionmailbox (6.0.3.7)
actionpack (= 6.0.3.7)
activejob (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (= 6.0.3.7)
activesupport (= 6.0.3.7)
mail (>= 2.7.1)
actionmailer (6.0.3.7)
actionpack (= 6.0.3.7)
actionview (= 6.0.3.7)
activejob (= 6.0.3.7)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.6)
actionview (= 5.2.6)
activesupport (= 5.2.6)
actionpack (6.0.3.7)
actionview (= 6.0.3.7)
activesupport (= 6.0.3.7)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.6)
activesupport (= 5.2.6)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.3.7)
actionpack (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (= 6.0.3.7)
activesupport (= 6.0.3.7)
nokogiri (>= 1.8.5)
actionview (6.0.3.7)
activesupport (= 6.0.3.7)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.2.6)
activesupport (= 5.2.6)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.3.7)
activesupport (= 6.0.3.7)
globalid (>= 0.3.6)
activemodel (5.2.6)
activesupport (= 5.2.6)
activemodel (6.0.3.7)
activesupport (= 6.0.3.7)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (5.2.6)
activemodel (= 5.2.6)
activesupport (= 5.2.6)
arel (>= 9.0)
activestorage (5.2.6)
actionpack (= 5.2.6)
activerecord (= 5.2.6)
activerecord (6.0.3.7)
activemodel (= 6.0.3.7)
activesupport (= 6.0.3.7)
activestorage (6.0.3.7)
actionpack (= 6.0.3.7)
activejob (= 6.0.3.7)
activerecord (= 6.0.3.7)
marcel (~> 1.0.0)
activesupport (5.2.6)
activesupport (6.0.3.7)
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-taggable-on (7.0.0)
activerecord (>= 5.0, < 6.2)
acts_as_commentable (4.0.2)
Expand All @@ -55,7 +77,6 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
arel (9.0.0)
ast (2.4.2)
autoprefixer-rails (10.2.4.0)
execjs
Expand Down Expand Up @@ -245,18 +266,20 @@ GEM
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.6)
actioncable (= 5.2.6)
actionmailer (= 5.2.6)
actionpack (= 5.2.6)
actionview (= 5.2.6)
activejob (= 5.2.6)
activemodel (= 5.2.6)
activerecord (= 5.2.6)
activestorage (= 5.2.6)
activesupport (= 5.2.6)
rails (6.0.3.7)
actioncable (= 6.0.3.7)
actionmailbox (= 6.0.3.7)
actionmailer (= 6.0.3.7)
actionpack (= 6.0.3.7)
actiontext (= 6.0.3.7)
actionview (= 6.0.3.7)
activejob (= 6.0.3.7)
activemodel (= 6.0.3.7)
activerecord (= 6.0.3.7)
activestorage (= 6.0.3.7)
activesupport (= 6.0.3.7)
bundler (>= 1.3.0)
railties (= 5.2.6)
railties (= 6.0.3.7)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
Expand All @@ -267,9 +290,9 @@ GEM
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
rails-i18n (5.1.3)
rails-i18n (6.0.0)
i18n (>= 0.7, < 2)
railties (>= 5.0, < 6)
railties (>= 6.0.0, < 7)
rails-observers (0.1.5)
activemodel (>= 4.0)
rails3-jquery-autocomplete (1.0.15)
Expand All @@ -281,12 +304,12 @@ GEM
rails (> 3.1)
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (5.2.6)
actionpack (= 5.2.6)
activesupport (= 5.2.6)
railties (6.0.3.7)
actionpack (= 6.0.3.7)
activesupport (= 6.0.3.7)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
thor (>= 0.20.3, < 2.0)
rainbow (3.0.0)
rake (13.0.3)
ransack (2.4.2)
Expand All @@ -309,8 +332,6 @@ GEM
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
responds_to_parent (2.0.0)
actionpack (>= 3.2.22, < 6.0)
rexml (3.2.5)
rspec (3.10.0)
rspec-core (~> 3.10.0)
Expand Down Expand Up @@ -384,7 +405,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.3.13)
sqlite3 (1.4.2)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
Expand Down Expand Up @@ -413,6 +434,7 @@ GEM
will_paginate (3.3.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.4.2)
zeus (0.15.14)
method_source (>= 0.6.7)

Expand Down Expand Up @@ -464,7 +486,7 @@ DEPENDENCIES
premailer
pry-rails
puma
rails (~> 5.2.0)
rails (~> 6.0.0)
rails-controller-testing
rails-i18n
rails-observers
Expand All @@ -478,7 +500,7 @@ DEPENDENCIES
rb-fsevent
rb-inotify
responders (~> 3.0)
responds_to_parent
responds_to_parent!
rspec-activemodel-mocks
rspec-rails
rubocop (~> 0.82.0)
Expand All @@ -488,7 +510,7 @@ DEPENDENCIES
selenium-webdriver
simple_form
sprockets-rails (>= 3.0.0)
sqlite3 (~> 1.3.13)
sqlite3 (~> 1.4.0)
thor
timecop
tzinfo-data
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Visit our website at http://www.fatfreecrm.com/

## System Requirements

* Ruby 2.4+ recommended
* Ruby 2.6+ recommended
* MySQL v4.1.1 or later (v5+ is recommended), SQLite v3.4 or later, or Postgres 8.4.8 or later.
* ImageMagick (optional, only needed if you would like to use avatars)

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/field_groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def create
#----------------------------------------------------------------------------
def update
@field_group = FieldGroup.find(params[:id])
@field_group.update_attributes(field_group_params)
@field_group.update(field_group_params)

respond_with(@field_group)
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/fields_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def update
@field = CustomFieldPair.update_pair(params).first
else
@field = Field.find(params[:id])
@field.update_attributes(field_params)
@field.update(field_params)
end

respond_with(@field)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/admin/groups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def create
# PUT /groups/1
#----------------------------------------------------------------------------
def update
@group.update_attributes(group_params)
@group.update(group_params)

respond_with(@group)
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/admin/tags_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def edit
# POST /admin/tags.xml AJAX
#----------------------------------------------------------------------------
def create
@tag.update_attributes(tag_params)
@tag.update(tag_params)

respond_with(@tag)
end
Expand All @@ -44,7 +44,7 @@ def create
# PUT /admin/tags/1.xml AJAX
#----------------------------------------------------------------------------
def update
@tag.update_attributes(tag_params)
@tag.update(tag_params)

respond_with(@tag)
end
Expand Down
10 changes: 10 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ def auto_complete
end
end

# To deal with pre rails 6 users, reset the session and ask them to relogin
rescue_from ArgumentError do |exception|
if request.format.html? && exception.message == "invalid base64"
request.reset_session
redirect_to login_path
else
raise(exception)
end
end

private

#
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/comments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def create
#----------------------------------------------------------------------------
def update
@comment = Comment.find(params[:id])
@comment.update_attributes(comment_params)
@comment.update(comment_params)
respond_with(@comment)
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/entities/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def update
respond_with(@account) do |_format|
# Must set access before user_ids, because user_ids= method depends on access value.
@account.access = params[:account][:access] if params[:account][:access]
get_data_for_sidebar if @account.update_attributes(resource_params)
get_data_for_sidebar if @account.update(resource_params)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/entities/campaigns_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def update
respond_with(@campaign) do |_format|
# Must set access before user_ids, because user_ids= method depends on access value.
@campaign.access = resource_params[:access] if resource_params[:access]
get_data_for_sidebar if @campaign.update_attributes(resource_params) && called_from_index_page?
get_data_for_sidebar if @campaign.update(resource_params) && called_from_index_page?
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/lists_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create

# Find any existing list with the same name (case insensitive)
if @list = List.where("lower(name) = ?", list_params[:name].downcase).where(user_id: list_params[:user_id]).first
@list.update_attributes(list_params)
@list.update(list_params)
else
@list = List.create(list_params)
end
Expand Down
Loading