-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
App and specs working under Ruby 3.1.4 #1138 #1139
Merged
CloCkWeRX
merged 9 commits into
fatfreecrm:master
from
ferrisoxide:1138_ruby_2_7_has_reached_eol
Aug 10, 2023
Merged
Changes from 7 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
fec8655
1138 app and specs working under Ruby 3.0.6
ferrisoxide 6406312
Merge branch 'master' into 1138_ruby_2_7_has_reached_eol
CloCkWeRX 3a79a28
Update Gemfile.lock
CloCkWeRX 56ffbd8
1138 upgrade brakeman
ferrisoxide a72ea81
1138 upgrade PaperTrail, Ruby to 3.1
ferrisoxide a31b2e6
1138 update ruby version in Dockerfile
ferrisoxide 3abfe60
1138 one more attempt at updating ruby version
ferrisoxide 1cdcf71
1138 update brakeman-analysis
ferrisoxide b3a5c6d
1138 use yaml_column_permitted_classes config
ferrisoxide File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,5 @@ Design | |
|
||
.passenger | ||
.vagrant | ||
storage/ | ||
storage/ | ||
.byebug_history |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.7.5 | ||
3.1.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem| | |
gem.email = ['[email protected]', '[email protected]', '[email protected]'] | ||
gem.files = Dir["{app,config,db,lib,vendor,public,bin,log/script}/**/*", "MIT-LICENSE", "Rakefile", "README.md", "config.ru", "CHANGELOG.md", "CONTRIBUTING.md"] | ||
gem.version = FatFreeCRM::VERSION::STRING | ||
gem.required_ruby_version = '>= 2.7.0' | ||
gem.required_ruby_version = '>= 3.1' | ||
gem.license = 'MIT' | ||
|
||
gem.add_dependency 'rails', '~> 6.1.0' | ||
|
@@ -27,7 +27,7 @@ Gem::Specification.new do |gem| | |
gem.add_dependency 'select2-rails' | ||
gem.add_dependency 'simple_form' | ||
gem.add_dependency 'will_paginate' | ||
gem.add_dependency 'paper_trail', '~> 12.0.0' | ||
gem.add_dependency 'paper_trail', '~> 15.0.0' | ||
gem.add_dependency 'devise', '~> 4.6' | ||
gem.add_dependency 'devise-encryptable', '~> 0.2.0' | ||
gem.add_dependency 'acts_as_commentable', '~> 6.0.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# frozen_string_literal: true | ||
|
||
# Copyright (c) 2008-2013 Michael Dvorkin and contributors. | ||
# | ||
# Fat Free CRM is freely distributable under the terms of MIT license. | ||
# See MIT-LICENSE file or http://www.opensource.org/licenses/mit-license.php | ||
#------------------------------------------------------------------------------ | ||
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper') | ||
|
||
describe 'I18n.t()' do | ||
|
||
|
||
class TestController < ActionController::Base | ||
|
||
include FatFreeCRM::I18n | ||
end | ||
|
||
let(:entity_string) { 'entities' } | ||
let(:hidden_count) { 10 } | ||
let(:test_controller) { TestController.new } | ||
|
||
it 'should translate hash arguments' do | ||
expect(test_controller.t(:not_showing_hidden_entities, entity: entity_string, count: hidden_count)) | ||
.to eq("Not showing 10 hidden entities.") | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/paper-trail-gem/paper_trail/blob/master/doc/pt_13_yaml_safe_load.md#to-continue-using-the-yaml-serializer might be worth looking through, so that people upgrading don't have any issues with legacy data (but also no security issues)
not sure if we just need to add a bunch of internal models (Account, Lead, Opportunity etc) as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Allowing all classes to be serialized/deserialized via Psych isn't great, but you can't specify the model classes in
application.rb
(they haven't been loaded at this point). Naively moving the configuration to an initializer breaks, with some Active Support classes being marked as a disallowed class in specs. I'm not sure why just yet.I'm also a bit worried about serialization of associated objects - I suspect we'd have to declare all possible compositions, not just the base model classes.
Fixing this might be tricky. I'd suggest that we look at securing serialization in a separate ticket as I've no idea how far down the rabbit hole this is going to go. Right now, leaving
use_yaml_unsafe_load
set totrue
is no more unsafe than what is present in the app - and only appears to impact Paper Trailversions
records that can't be directly manipulated by users.In a perfect world we wouldn't be using YAML serialization for Paper Trail, but I think JSON-based serialization is only available on Postgres. I see you've already identified this as an issue per #1146.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
☝️ Actually, scrap that. The proposed change seems to be working without adding models - at least in specs. I'll be more comfortable making this change after I've given the front end a manual test - will look at doing that tomorrow.