Skip to content

Commit

Permalink
upgrade rails 7.1 -> 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
senid231 committed Jan 21, 2025
1 parent 47c24fe commit 3a20fce
Show file tree
Hide file tree
Showing 25 changed files with 418 additions and 166 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem 'pg'
gem 'pg_advisory_lock', git: 'https://github.com/didww/pg_advisory_lock.git'
gem 'pg_sql_caller', git: 'https://github.com/didww/pg_sql_caller.git'
gem 'rack', ' ~> 2.2.6'
gem 'rails', '~> 7.1.0'
gem 'rails', '~> 7.2.0'
gem 'responders'

# Authentication
Expand Down Expand Up @@ -52,7 +52,7 @@ gem 'jsonapi-resources', '~> 0.9.12'
# Ext
gem 'validates_timeliness', '~> 7.0.0.beta1'

# Object oriented authorization for Rails applications
# Object-oriented authorization for Rails applications
gem 'pundit'

gem 'paper_trail'
Expand Down
146 changes: 70 additions & 76 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -96,51 +96,46 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.5.1)
actionpack (= 7.1.5.1)
activesupport (= 7.1.5.1)
actioncable (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.5.1)
actionpack (= 7.1.5.1)
actionview (= 7.1.5.1)
activejob (= 7.1.5.1)
activesupport (= 7.1.5.1)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
actionmailbox (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
actionmailer (7.2.2.1)
actionpack (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activesupport (= 7.2.2.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.1.5.1)
actionview (= 7.1.5.1)
activesupport (= 7.1.5.1)
actionpack (7.2.2.1)
actionview (= 7.2.2.1)
activesupport (= 7.2.2.1)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack (>= 2.2.4, < 3.2)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.5.1)
actionpack (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
useragent (~> 0.16)
actiontext (7.2.2.1)
actionpack (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.5.1)
activesupport (= 7.1.5.1)
actionview (7.2.2.1)
activesupport (= 7.2.2.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
Expand All @@ -156,8 +151,8 @@ GEM
active_admin_sidebar (1.1.0)
activeadmin
active_admin_theme (1.1.2)
active_record_extended (3.2.1)
activerecord (>= 5.2, < 7.2.0)
active_record_extended (3.3.0)
activerecord (>= 5.2, < 8.0.0)
pg (< 3.0)
activeadmin (3.2.2)
arbre (~> 1.2, >= 1.2.1)
Expand All @@ -169,46 +164,45 @@ GEM
kaminari (>= 1.2.1)
railties (>= 6.1)
ransack (>= 4.0)
activejob (7.1.5.1)
activesupport (= 7.1.5.1)
activejob (7.2.2.1)
activesupport (= 7.2.2.1)
globalid (>= 0.3.6)
activeldap (5.1.1)
activemodel (> 4.0.0)
builder
gettext
gettext_i18n_rails
locale
activemodel (7.1.5.1)
activesupport (= 7.1.5.1)
activemodel (7.2.2.1)
activesupport (= 7.2.2.1)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (7.1.5.1)
activemodel (= 7.1.5.1)
activesupport (= 7.1.5.1)
activerecord (7.2.2.1)
activemodel (= 7.2.2.1)
activesupport (= 7.2.2.1)
timeout (>= 0.4.0)
activerecord-import (2.0.0)
activerecord (>= 4.2)
activestorage (7.1.5.1)
actionpack (= 7.1.5.1)
activejob (= 7.1.5.1)
activerecord (= 7.1.5.1)
activesupport (= 7.1.5.1)
activestorage (7.2.2.1)
actionpack (= 7.2.2.1)
activejob (= 7.2.2.1)
activerecord (= 7.2.2.1)
activesupport (= 7.2.2.1)
marcel (~> 1.0)
activesupport (7.1.5.1)
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
securerandom (>= 0.3)
tzinfo (~> 2.0)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
annotate (3.2.0)
Expand Down Expand Up @@ -288,10 +282,10 @@ GEM
activerecord (>= 3.2)
date (3.3.3)
deep_merge (1.2.1)
delayed_job (4.1.11)
activesupport (>= 3.0, < 8.0)
delayed_job_active_record (4.1.7)
activerecord (>= 3.0, < 8.0)
delayed_job (4.1.13)
activesupport (>= 3.0, < 9.0)
delayed_job_active_record (4.1.11)
activerecord (>= 3.0, < 9.0)
delayed_job (>= 3.0, < 5)
devise (4.9.4)
bcrypt (~> 3.0)
Expand Down Expand Up @@ -451,7 +445,6 @@ GEM
msgpack (1.7.2)
multi_xml (0.6.0)
mustache (1.1.1)
mutex_m (0.3.0)
net-imap (0.3.6)
date
net-protocol
Expand Down Expand Up @@ -697,38 +690,38 @@ GEM
rackup (1.0.1)
rack (< 3)
webrick
rails (7.1.5.1)
actioncable (= 7.1.5.1)
actionmailbox (= 7.1.5.1)
actionmailer (= 7.1.5.1)
actionpack (= 7.1.5.1)
actiontext (= 7.1.5.1)
actionview (= 7.1.5.1)
activejob (= 7.1.5.1)
activemodel (= 7.1.5.1)
activerecord (= 7.1.5.1)
activestorage (= 7.1.5.1)
activesupport (= 7.1.5.1)
rails (7.2.2.1)
actioncable (= 7.2.2.1)
actionmailbox (= 7.2.2.1)
actionmailer (= 7.2.2.1)
actionpack (= 7.2.2.1)
actiontext (= 7.2.2.1)
actionview (= 7.2.2.1)
activejob (= 7.2.2.1)
activemodel (= 7.2.2.1)
activerecord (= 7.2.2.1)
activestorage (= 7.2.2.1)
activesupport (= 7.2.2.1)
bundler (>= 1.15.0)
railties (= 7.1.5.1)
railties (= 7.2.2.1)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.1)
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.1.5.1)
actionpack (= 7.1.5.1)
activesupport (= 7.1.5.1)
irb
railties (7.2.2.1)
actionpack (= 7.2.2.1)
activesupport (= 7.2.2.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.0.6)
ransack (4.1.1)
ransack (4.2.1)
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
Expand Down Expand Up @@ -858,6 +851,7 @@ GEM
unicode (0.4.4.5)
unicode-display_width (2.4.2)
uniform_notifier (1.16.0)
useragent (0.16.11)
validates_timeliness (7.0.0.beta2)
activemodel (>= 7.0.0, < 8)
timeliness (>= 0.3.10, < 1)
Expand Down Expand Up @@ -956,7 +950,7 @@ DEPENDENCIES
puma_worker_killer
pundit
rack (~> 2.2.6)
rails (~> 7.1.0)
rails (~> 7.2.0)
rails-html-sanitizer (>= 1.6.1)
ransack
responders
Expand Down Expand Up @@ -988,4 +982,4 @@ DEPENDENCIES
zip-zip

BUNDLED WITH
2.6.2
2.6.3
6 changes: 3 additions & 3 deletions app/models/concerns/routing_tag_ids_scopeable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ module RoutingTagIdsScopeable
included do
scope :routing_tag_ids_covers, lambda { |*routing_tag_ids|
type = ActiveModel::Type::Integer.new(limit: 2)
routing_tag_ids = routing_tag_ids.map do |id|
serialized_tag_ids = routing_tag_ids.map do |id|
type.serialize(id)
rescue ActiveModel::RangeError
nil
end
return none if routing_tag_ids.any?(&:nil?)
return none if serialized_tag_ids.any?(&:nil?)

where('yeti_ext.tag_compare(routing_tag_ids, ARRAY[?], routing_tag_mode_id)>0', routing_tag_ids)
where('yeti_ext.tag_compare(routing_tag_ids, ARRAY[?]::smallint[], routing_tag_mode_id)>0', serialized_tag_ids)
}

scope :tagged, lambda { |value|
Expand Down
6 changes: 5 additions & 1 deletion app/models/report/realtime/bad_routing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,11 @@ class Report::Realtime::BadRouting < Report::Realtime::Base
}

scope :time_interval_eq, lambda { |value|
where('time_start >=(now()-\'? seconds\'::interval) and time_start < (now()-\'? seconds\'::interval)', 2 * value.to_i, value.to_i)
where(
"time_start >= (now()-(?::varchar||' seconds')::interval) AND time_start < (now()-(?::varchar||' seconds')::interval)",
2 * value.to_i,
value.to_i
)
}

private
Expand Down
6 changes: 3 additions & 3 deletions app/models/report/realtime/not_authenticated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,9 @@ class Report::Realtime::NotAuthenticated < Report::Realtime::Base

scope :time_interval_eq, lambda { |value|
where(
"time_start >=(now()-(?||'seconds')::interval) and time_start < (now()-(?||'seconds')::interval)",
(2 * value.to_i).to_s,
value.to_i.to_s
"time_start >=(now()-(?::varchar||' seconds')::interval) and time_start < (now()-(?||'seconds')::interval)",
2 * value.to_i,
value.to_i
)
}

Expand Down
6 changes: 5 additions & 1 deletion app/models/report/realtime/origination_performance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ class Report::Realtime::OriginationPerformance < Report::Realtime::Base
}

scope :time_interval_eq, lambda { |value|
where('time_start >=(now()-\'? seconds\'::interval) and time_start < (now()-\'? seconds\'::interval)', 2 * value.to_i, value.to_i)
where(
"time_start >= (now()-(?::varchar||' seconds')::interval) AND time_start < (now()-(?::varchar||' seconds')::interval)",
2 * value.to_i,
value.to_i
)
}

private
Expand Down
15 changes: 10 additions & 5 deletions app/models/stats/termination_quality_stat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def self.total
min(pdd) as min_pdd,
#{GuiConfig.termination_stats_window}::integer as w
").where(
"time_start>= now()-'? hours'::interval", GuiConfig.termination_stats_window
"time_start>= now()-(?::varchar||' hours')::interval",
GuiConfig.termination_stats_window
).reorder('').take
end

Expand All @@ -51,7 +52,8 @@ def self.dp_measurement
max(pdd) as max_pdd,
min(pdd) as min_pdd,
dialpeer_id").where(
"time_start>= now()-'? hours'::interval and dialpeer_id is not null", GuiConfig.termination_stats_window
"time_start>= now()-(?::varchar||' hours')::interval and dialpeer_id is not null",
GuiConfig.termination_stats_window
).group('dialpeer_id').having(
'count(id)>=? AND sum(duration)>=?', min_calls_count, min_calls_duration
).reorder('')
Expand All @@ -67,7 +69,8 @@ def self.gw_measurement
max(pdd) as max_pdd,
min(pdd) as min_pdd,
gateway_id").where(
"time_start>= now()-'? hours'::interval and gateway_id is not null", GuiConfig.termination_stats_window
"time_start>= now()-(?::varchar||' hours')::interval and gateway_id is not null",
GuiConfig.termination_stats_window
).group('gateway_id').having(
'count(id)>=? AND sum(duration)>=?', min_calls_count, min_calls_duration
).reorder('')
Expand All @@ -83,15 +86,17 @@ def self.dst_measurement
max(pdd) as max_pdd,
min(pdd) as min_pdd,
destination_id").where(
"time_start>= now()-'? hours'::interval and destination_id is not null", GuiConfig.termination_stats_window
"time_start>= now()-(?::varchar||' hours')::interval and destination_id is not null",
GuiConfig.termination_stats_window
).group('destination_id').having(
'count(id)>=? AND sum(duration)>=?', min_calls_count, min_calls_duration
).reorder('')
end

def self.pdd_distribution
select('pdd::integer, count(id)').where(
"time_start>= now()-'? hours'::interval", GuiConfig.termination_stats_window
"time_start>= now()-(?::varchar||' hours')::interval",
GuiConfig.termination_stats_window
).where(success: true).group('pdd::integer').order('pdd::integer ASC')
end

Expand Down
Loading

0 comments on commit 3a20fce

Please sign in to comment.