Skip to content

Commit 16009b2

Browse files
committed
WIP ruby 3.0 support
1 parent 49a0131 commit 16009b2

11 files changed

Lines changed: 14 additions & 10 deletions

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.4
1+
3.0.2

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ gem 'will_paginate', '~> 3.0'
4747

4848
# ruby 2.7 support for activesupport 4.2.x
4949
gem 'bigdecimal', '~> 1.4.4'
50+
# ruby 3.0 support
51+
gem 'webrick'
5052

5153
# Use jquery as the JavaScript library
5254
gem 'jquery-rails'

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ GEM
357357
addressable (>= 2.3.6)
358358
crack (>= 0.3.2)
359359
hashdiff (>= 0.4.0, < 2.0.0)
360+
webrick (1.7.0)
360361
will_paginate (3.3.0)
361362
xpath (3.2.0)
362363
nokogiri (~> 1.8)
@@ -402,6 +403,7 @@ DEPENDENCIES
402403
spring-commands-rspec
403404
uglifier (>= 1.3.0)
404405
webmock
406+
webrick
405407
will_paginate (~> 3.0)
406408

407409
BUNDLED WITH

app/models/bin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Bin < ActiveRecord::Base
22
require 'net/http'
33

4-
default_scope { order(:identifier) }
4+
default_scope lambda { order(:identifier) }
55
after_initialize :default_values
66

77
belongs_to :batch

app/models/digital_file_provenance.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ class DigitalFileProvenance < ActiveRecord::Base
33
before_save :nullify_na_values
44
belongs_to :digital_provenance
55
belongs_to :signal_chain
6-
default_scope { order(:id) }
6+
default_scope lambda { order(:filename) }
77

88
attr_accessor :display_date_digitized
99
validates :digital_provenance, presence: true
@@ -22,7 +22,7 @@ class DigitalFileProvenance < ActiveRecord::Base
2222
validate :filename_validation
2323
validate :validate_signal_chain
2424

25-
default_scope { order(:filename) }
25+
2626

2727
# File Uses:
2828
# pres for preservation master

app/models/machine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
class Machine < ActiveRecord::Base
22
validates :category, presence: true
33
validates :serial, presence: true
4-
default_scope {
4+
default_scope lambda {
55
# FIXME:
66
# this order interferes with the processing_steps position order, but I think that removing this
77
# simply results in the order of machines in a device chain being the id order of the machine

app/models/processing_step.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class ProcessingStep < ActiveRecord::Base
55
validates :machine, presence: true
66
validates :position, presence: true, numericality: { greater_than: 0 }, uniqueness: { scope: :signal_chain }
77
validate :validate_format_compatibility
8-
default_scope { order(:signal_chain_id, :position) }
8+
default_scope lambda { order(:signal_chain_id, :position) }
99

1010
def validate_format_compatibility
1111
if signal_chain && machine

app/models/signal_chain.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
class SignalChain < ActiveRecord::Base
22
validates :name, presence: true, uniqueness: true
3-
default_scope { order(:name) }
3+
default_scope lambda { order(:name) }
44
has_many :processing_steps, dependent: :destroy
55
has_many :machines, through: :processing_steps
66
has_many :signal_chain_formats, dependent: :destroy

app/models/unit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Unit < ActiveRecord::Base
2-
default_scope { order(:abbreviation) }
2+
default_scope lambda { order(:abbreviation) }
33
validates :abbreviation, presence: true, uniqueness: true
44
validates :name, presence: true, uniqueness: { scope: [:institution, :campus] }
55

app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class User < ActiveRecord::Base
55

66
belongs_to :unit
77

8-
default_scope { order(:name) }
8+
default_scope lambda { order(:name) }
99

1010
def self.authenticate(username)
1111
return false if username.nil? || username.blank?

0 commit comments

Comments
 (0)