From a7ff2b63f430ab06fc2d3f145bbf9e595660aaa3 Mon Sep 17 00:00:00 2001 From: Ben Ward Date: Wed, 3 Dec 2025 14:00:44 -1000 Subject: [PATCH 1/4] Support for Rails 7 --- .ruby-version | 2 +- lead_router_receiver.gemspec | 2 +- lib/lead_router_receiver/engine.rb | 2 +- lib/lead_router_receiver/version.rb | 2 +- spec/dummy/.ruby-version | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.ruby-version b/.ruby-version index a4dd9db..e4604e3 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.7.4 +3.2.1 diff --git a/lead_router_receiver.gemspec b/lead_router_receiver.gemspec index cae73e9..48eca37 100644 --- a/lead_router_receiver.gemspec +++ b/lead_router_receiver.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |s| s.files = Dir["{app,config,db,lib}/**/*", "MIT-LICENSE", "Rakefile", "README.md"] s.test_files = Dir["spec/**/*"] - s.add_dependency "rails", ">= 5.2", "< 7.0" + s.add_dependency "rails", ">= 5.2", "< 8.0" s.add_development_dependency "sqlite3" s.add_development_dependency "rspec-rails" diff --git a/lib/lead_router_receiver/engine.rb b/lib/lead_router_receiver/engine.rb index fcd58c1..190a7b8 100644 --- a/lib/lead_router_receiver/engine.rb +++ b/lib/lead_router_receiver/engine.rb @@ -9,7 +9,7 @@ class Engine < ::Rails::Engine config.to_prepare do Dir.glob( Rails.root + "app/decorators/**/*_decorator*.rb" ).each do |c| - require_dependency(c) + require(c) end end end diff --git a/lib/lead_router_receiver/version.rb b/lib/lead_router_receiver/version.rb index c86a60b..dad5099 100644 --- a/lib/lead_router_receiver/version.rb +++ b/lib/lead_router_receiver/version.rb @@ -1,3 +1,3 @@ module LeadRouterReceiver - VERSION = '0.2.3' + VERSION = '0.3.0' end diff --git a/spec/dummy/.ruby-version b/spec/dummy/.ruby-version index 58073ef..0444f32 100644 --- a/spec/dummy/.ruby-version +++ b/spec/dummy/.ruby-version @@ -1 +1 @@ -2.4.1 \ No newline at end of file +3.2.1 \ No newline at end of file From 5fd63a0ccee5d645db2c86e3dd65bb64490e3ae6 Mon Sep 17 00:00:00 2001 From: Ben Ward Date: Wed, 3 Dec 2025 15:05:26 -1000 Subject: [PATCH 2/4] Fix Rails 7 serialization compatibility for processing_log - Update serialize method syntax for Rails 7 - Fix Time serialization by storing as ISO8601 string - Add backward compatibility for time parsing --- app/models/lead_router_receiver/has_processing_log.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/models/lead_router_receiver/has_processing_log.rb b/app/models/lead_router_receiver/has_processing_log.rb index 3ba44af..2ee910d 100644 --- a/app/models/lead_router_receiver/has_processing_log.rb +++ b/app/models/lead_router_receiver/has_processing_log.rb @@ -21,13 +21,18 @@ def error! ; record_status "error" ; save! ; end def record_event(message, clock: Clock.for_current_time) cache_event_message message self.processing_log ||= Array.new - event = HasProcessingLog::Event.new( message, clock.to_time ) + event = HasProcessingLog::Event.new( message, clock.to_time.iso8601(6) ) self.processing_log << event.to_a end def processing_events Array(processing_log).map { |event| - HasProcessingLog::Event.new( *Array(event) ) + event_array = Array(event) + # Convert time string back to Time object if it's a string + if event_array[1].is_a?(String) + event_array[1] = Time.parse(event_array[1]) + end + HasProcessingLog::Event.new( *event_array ) } end @@ -48,7 +53,7 @@ class MissingRequiredColumns < TypeError ; end def self.included(receiver) require_processing_columns!(receiver) - receiver.serialize :processing_log, Array + receiver.serialize :processing_log, type: Array # For ease of console debugging, we record the [first N chars of] # the last event message. N depends on the individual table, so From 56545ea79464c536248b2c5c95128fd507de8c5e Mon Sep 17 00:00:00 2001 From: Ben Ward Date: Wed, 3 Dec 2025 15:05:52 -1000 Subject: [PATCH 3/4] Update RSpec config for Rails 7 / RSpec Rails 8.x compatibility --- spec/rails_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index d0fcc5f..f074931 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -28,7 +28,7 @@ RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures - config.fixture_path = "#{::Rails.root}/spec/fixtures" + config.fixture_paths = ["#{::Rails.root}/spec/fixtures"] # If you're not using ActiveRecord, or you'd prefer not to run each of your # examples within a transaction, remove the following line or assign false From 972ad64bc56d8e05d7425990be5948193206b855 Mon Sep 17 00:00:00 2001 From: Ben Ward Date: Wed, 3 Dec 2025 15:06:39 -1000 Subject: [PATCH 4/4] Update Gemfile.lock --- Gemfile.lock | 318 ++++++++++++++++++++++++++++++++------------------- 1 file changed, 198 insertions(+), 120 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 43e7054..7cd0984 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,150 +1,228 @@ PATH remote: . specs: - lead_router_receiver (0.2.3) - rails (>= 5.2, < 7.0) + lead_router_receiver (0.3.0) + rails (>= 5.2, < 8.0) GEM remote: https://rubygems.org/ specs: - actioncable (5.2.6) - actionpack (= 5.2.6) + actioncable (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.6) - actionpack (= 5.2.6) - actionview (= 5.2.6) - activejob (= 5.2.6) - mail (~> 2.5, >= 2.5.4) - rails-dom-testing (~> 2.0) - actionpack (5.2.6) - actionview (= 5.2.6) - activesupport (= 5.2.6) - rack (~> 2.0, >= 2.0.8) + zeitwerk (~> 2.6) + actionmailbox (7.2.3) + actionpack (= 7.2.3) + activejob (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + mail (>= 2.8.0) + actionmailer (7.2.3) + actionpack (= 7.2.3) + actionview (= 7.2.3) + activejob (= 7.2.3) + activesupport (= 7.2.3) + mail (>= 2.8.0) + rails-dom-testing (~> 2.2) + actionpack (7.2.3) + actionview (= 7.2.3) + activesupport (= 7.2.3) + cgi + nokogiri (>= 1.8.5) + racc + rack (>= 2.2.4, < 3.3) + rack-session (>= 1.0.1) 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-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actiontext (7.2.3) + actionpack (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + globalid (>= 0.6.0) + nokogiri (>= 1.8.5) + actionview (7.2.3) + activesupport (= 7.2.3) 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) + cgi + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activejob (7.2.3) + activesupport (= 7.2.3) globalid (>= 0.3.6) - activemodel (5.2.6) - activesupport (= 5.2.6) - 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) - marcel (~> 1.0.0) - activesupport (5.2.6) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) - arel (9.0.0) + activemodel (7.2.3) + activesupport (= 7.2.3) + activerecord (7.2.3) + activemodel (= 7.2.3) + activesupport (= 7.2.3) + timeout (>= 0.4.0) + activestorage (7.2.3) + actionpack (= 7.2.3) + activejob (= 7.2.3) + activerecord (= 7.2.3) + activesupport (= 7.2.3) + marcel (~> 1.0) + activesupport (7.2.3) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) awesome_print (1.9.2) - builder (3.2.4) - climate_control (1.0.1) - concurrent-ruby (1.1.9) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (3.3.1) + builder (3.3.0) + cgi (0.5.0) + climate_control (1.2.0) + concurrent-ruby (1.3.5) + connection_pool (2.5.5) crass (1.0.6) - diff-lcs (1.4.4) - erubi (1.10.0) - globalid (0.5.2) - activesupport (>= 5.0) - i18n (1.8.10) + date (3.5.0) + diff-lcs (1.6.2) + drb (2.2.3) + erb (6.0.0) + erubi (1.13.1) + globalid (1.3.0) + activesupport (>= 6.1) + i18n (1.14.7) concurrent-ruby (~> 1.0) - loofah (2.12.0) + io-console (0.8.1) + irb (1.15.3) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + logger (1.7.0) + loofah (2.24.1) crass (~> 1.0.2) - nokogiri (>= 1.5.9) - mail (2.7.1) + nokogiri (>= 1.12.0) + mail (2.9.0) + logger mini_mime (>= 0.1.1) - marcel (1.0.2) - method_source (1.0.0) - mini_mime (1.1.1) - mini_portile2 (2.6.1) - minitest (5.14.4) - nio4r (2.5.8) - nokogiri (1.12.4) - mini_portile2 (~> 2.6.1) + net-imap + net-pop + net-smtp + marcel (1.1.0) + mini_mime (1.1.5) + mini_portile2 (2.8.9) + minitest (5.26.2) + net-imap (0.5.12) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.1) + net-protocol + nio4r (2.7.5) + nokogiri (1.18.10) + mini_portile2 (~> 2.8.2) racc (~> 1.4) - nokogiri (1.12.4-x86_64-darwin) - racc (~> 1.4) - racc (1.5.2) - 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) - bundler (>= 1.3.0) - railties (= 5.2.6) - sprockets-rails (>= 2.0.0) - rails-dom-testing (2.0.3) - activesupport (>= 4.2.0) + pp (0.6.3) + prettyprint + prettyprint (0.2.0) + psych (5.2.6) + date + stringio + racc (1.8.1) + rack (3.2.4) + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) + rack (>= 1.3) + rackup (2.2.1) + rack (>= 3) + rails (7.2.3) + actioncable (= 7.2.3) + actionmailbox (= 7.2.3) + actionmailer (= 7.2.3) + actionpack (= 7.2.3) + actiontext (= 7.2.3) + actionview (= 7.2.3) + activejob (= 7.2.3) + activemodel (= 7.2.3) + activerecord (= 7.2.3) + activestorage (= 7.2.3) + activesupport (= 7.2.3) + bundler (>= 1.15.0) + railties (= 7.2.3) + rails-dom-testing (2.3.0) + activesupport (>= 5.0.0) + minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.4.2) - loofah (~> 2.3) - railties (5.2.6) - actionpack (= 5.2.6) - activesupport (= 5.2.6) - method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) - rake (13.0.6) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rails-html-sanitizer (1.6.2) + loofah (~> 2.21) + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (7.2.3) + actionpack (= 7.2.3) + activesupport (= 7.2.3) + cgi + irb (~> 1.13) + rackup (>= 1.0.0) + rake (>= 12.2) + thor (~> 1.0, >= 1.2.2) + tsort (>= 0.2) + zeitwerk (~> 2.6) + rake (13.3.1) + rdoc (6.16.1) + erb + psych (>= 4.0.0) + tsort + reline (0.6.3) + io-console (~> 0.5) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-its (1.3.0) - rspec-core (>= 3.0.0) - rspec-expectations (>= 3.0.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.13.0) + rspec-its (2.0.0) + rspec-core (>= 3.13.0) + rspec-expectations (>= 3.13.0) + rspec-mocks (3.13.7) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-rails (5.0.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - railties (>= 5.2) - rspec-core (~> 3.10) - rspec-expectations (~> 3.10) - rspec-mocks (~> 3.10) - rspec-support (~> 3.10) - rspec-support (3.10.2) - sprockets (4.0.2) - concurrent-ruby (~> 1.0) - rack (> 1, < 3) - sprockets-rails (3.2.2) - actionpack (>= 4.0) - activesupport (>= 4.0) - sprockets (>= 3.0.0) - sqlite3 (1.4.2) + rspec-support (~> 3.13.0) + rspec-rails (8.0.2) + actionpack (>= 7.2) + activesupport (>= 7.2) + railties (>= 7.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.6) + securerandom (0.4.1) + sqlite3 (2.8.1) + mini_portile2 (~> 2.8.0) + stringio (3.1.9) table_print (1.5.7) - thor (1.1.0) - thread_safe (0.3.6) - tzinfo (1.2.9) - thread_safe (~> 0.1) - websocket-driver (0.7.5) + thor (1.4.0) + timeout (0.4.4) + tsort (0.2.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + useragent (0.16.11) + websocket-driver (0.8.0) + base64 websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) + zeitwerk (2.7.3) PLATFORMS ruby - x86_64-darwin-19 DEPENDENCIES awesome_print