Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.
Draft
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
18 changes: 3 additions & 15 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,11 @@ ruby "3.1.0"

git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails', branch: 'main'
gem 'rails', '~> 6.1'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gem 'rails', '~> 7.0'
gem 'puma', '~> 5'
gem 'webpacker', '~> 5'
gem 'turbolinks', '~> 5'
# Use SCSS for stylesheets
# gem 'sass-rails', '>= 6'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
# gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'
gem 'sprockets-rails', :require => 'sprockets/railtie'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


# Reduces boot times through caching; required in config/boot.rb
gem 'net-imap', require: false
Expand Down Expand Up @@ -51,8 +40,7 @@ group :development do
gem 'web-console', '>= 3.3.0'
gem 'listen', '~> 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gem 'spring-watcher-listen', '~> 2.0.0'
gem 'spring', '~> 4.0'
end

gem "bugsnag", "~> 6.13"
Expand Down
137 changes: 70 additions & 67 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,73 +1,79 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
actioncable (7.0.2.4)
actionpack (= 7.0.2.4)
activesupport (= 7.0.2.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
actionmailbox (7.0.2.4)
actionpack (= 7.0.2.4)
activejob (= 7.0.2.4)
activerecord (= 7.0.2.4)
activestorage (= 7.0.2.4)
activesupport (= 7.0.2.4)
mail (>= 2.7.1)
actionmailer (6.1.4.6)
actionpack (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activesupport (= 6.1.4.6)
net-imap
net-pop
net-smtp
actionmailer (7.0.2.4)
actionpack (= 7.0.2.4)
actionview (= 7.0.2.4)
activejob (= 7.0.2.4)
activesupport (= 7.0.2.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.0)
actionpack (6.1.4.6)
actionview (= 6.1.4.6)
activesupport (= 6.1.4.6)
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.2.4)
actionview (= 7.0.2.4)
activesupport (= 7.0.2.4)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.6)
actionpack (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
actiontext (7.0.2.4)
actionpack (= 7.0.2.4)
activerecord (= 7.0.2.4)
activestorage (= 7.0.2.4)
activesupport (= 7.0.2.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.4.6)
activesupport (= 6.1.4.6)
actionview (7.0.2.4)
activesupport (= 7.0.2.4)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.4.6)
activesupport (= 6.1.4.6)
activejob (7.0.2.4)
activesupport (= 7.0.2.4)
globalid (>= 0.3.6)
activemodel (6.1.4.6)
activesupport (= 6.1.4.6)
activemodel (7.0.2.4)
activesupport (= 7.0.2.4)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (6.1.4.6)
activemodel (= 6.1.4.6)
activesupport (= 6.1.4.6)
activerecord (7.0.2.4)
activemodel (= 7.0.2.4)
activesupport (= 7.0.2.4)
activeresource (6.0.0)
activemodel (>= 6.0)
activemodel-serializers-xml (~> 1.0)
activesupport (>= 6.0)
activestorage (6.1.4.6)
actionpack (= 6.1.4.6)
activejob (= 6.1.4.6)
activerecord (= 6.1.4.6)
activesupport (= 6.1.4.6)
marcel (~> 1.0.0)
activestorage (7.0.2.4)
actionpack (= 7.0.2.4)
activejob (= 7.0.2.4)
activerecord (= 7.0.2.4)
activesupport (= 7.0.2.4)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.6)
activesupport (7.0.2.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
babel-source (5.8.35)
Expand All @@ -93,7 +99,7 @@ GEM
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
childprocess (4.1.0)
concurrent-ruby (1.1.9)
concurrent-ruby (1.1.10)
connection_pool (2.2.5)
crass (1.0.6)
digest (3.1.0)
Expand Down Expand Up @@ -159,7 +165,7 @@ GEM
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.14.0)
loofah (2.17.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand Down Expand Up @@ -228,21 +234,20 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.4.6)
actioncable (= 6.1.4.6)
actionmailbox (= 6.1.4.6)
actionmailer (= 6.1.4.6)
actionpack (= 6.1.4.6)
actiontext (= 6.1.4.6)
actionview (= 6.1.4.6)
activejob (= 6.1.4.6)
activemodel (= 6.1.4.6)
activerecord (= 6.1.4.6)
activestorage (= 6.1.4.6)
activesupport (= 6.1.4.6)
rails (7.0.2.4)
actioncable (= 7.0.2.4)
actionmailbox (= 7.0.2.4)
actionmailer (= 7.0.2.4)
actionpack (= 7.0.2.4)
actiontext (= 7.0.2.4)
actionview (= 7.0.2.4)
activejob (= 7.0.2.4)
activemodel (= 7.0.2.4)
activerecord (= 7.0.2.4)
activestorage (= 7.0.2.4)
activesupport (= 7.0.2.4)
bundler (>= 1.15.0)
railties (= 6.1.4.6)
sprockets-rails (>= 2.0.0)
railties (= 7.0.2.4)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
Expand All @@ -253,12 +258,13 @@ GEM
rails_stdout_logging
rails_serve_static_assets (0.0.5)
rails_stdout_logging (0.0.5)
railties (6.1.4.6)
actionpack (= 6.1.4.6)
activesupport (= 6.1.4.6)
railties (7.0.2.4)
actionpack (= 7.0.2.4)
activesupport (= 7.0.2.4)
method_source
rake (>= 0.13)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
rb-fsevent (0.11.1)
rb-inotify (0.10.1)
Expand Down Expand Up @@ -304,10 +310,7 @@ GEM
gli
hashie
websocket-driver
spring (2.1.1)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
spring (4.0.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
Expand Down Expand Up @@ -380,16 +383,16 @@ DEPENDENCIES
net-smtp
pg
puma (~> 5)
rails (~> 6.1)
rails (~> 7.0)
rails_12factor
react-rails
selenium-webdriver
sendgrid-ruby
shopify_app (~> 18)
skylight
slack-ruby-client
spring
spring-watcher-listen (~> 2.0.0)
spring (~> 4.0)
sprockets-rails
turbolinks (~> 5)
twilio-ruby
twitter
Expand Down
2 changes: 1 addition & 1 deletion app/models/rule_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def as_json
dump.merge({
shopify_identifier: @shopify_identifier,
hooklys_identifier: @hooklys_identifier,
timestamp: @details.first.timestamp.to_s(:db),
timestamp: @details.first.timestamp.to_fs(:db),

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DEPRECATION WARNING: Time#to_s(:db) is deprecated. Please use Time#to_fs(:db) instead.

error: @details.any? { _1.level == :error },
})
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/rule_event_detail.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def initialize(level:, message:)

def dump
{
"timestamp" => @timestamp.to_s(:db),
"timestamp" => @timestamp.to_fs(:db),
"level" => @level.to_s,
"message" => @message,
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/rules/_handler.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<div class="Polaris-FormLayout">
<%= f.polaris_select(:service_name, available_handlers.map { |handler| [handler.label, handler.to_s] }, { prompt: "Select an action" }, { data: { handler: true } }) %>

<%= f.fields_for :settings, f.object.settings do |ff| %>

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than guessing, I couldn't explain with a reproductible fact why this used to work in the first place and what made rails 7.0 upgrade break it.

It shouldn't have worked before since f.object.settings is a Hash and should have been treated as options, not as a record object....

<%= f.fields_for :settings do |ff| %>
<% available_handlers.each do |handler| %>
<div data-handler-details="<%= handler %>">
<% if handler.description.present? %>
Expand Down