Skip to content
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
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.4
3.0.2
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ gem 'will_paginate', '~> 3.0'

# ruby 2.7 support for activesupport 4.2.x
gem 'bigdecimal', '~> 1.4.4'
# ruby 3.0 support
gem 'webrick'

# Use jquery as the JavaScript library
gem 'jquery-rails'
Expand Down Expand Up @@ -100,7 +102,6 @@ group :development do
end

group :test do
gem 'selenium-webdriver'
gem 'capybara'
#for capybara javascript access
gem 'selenium-webdriver'
Expand Down
6 changes: 4 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ GEM
listen (3.7.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.12.0)
loofah (2.13.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.8)
Expand Down Expand Up @@ -325,7 +325,7 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
spring (3.1.1)
spring (4.0.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (2.12.5)
Expand Down Expand Up @@ -359,6 +359,7 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
will_paginate (3.3.1)
xpath (3.2.0)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -404,6 +405,7 @@ DEPENDENCIES
uglifier (>= 1.3.0)
webdrivers
webmock
webrick
will_paginate (~> 3.0)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion app/models/bin.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Bin < ActiveRecord::Base
require 'net/http'

default_scope { order(:identifier) }
default_scope lambda { order(:identifier) }
after_initialize :default_values

belongs_to :batch
Expand Down
4 changes: 2 additions & 2 deletions app/models/digital_file_provenance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class DigitalFileProvenance < ActiveRecord::Base
before_save :nullify_na_values
belongs_to :digital_provenance
belongs_to :signal_chain
default_scope { order(:id) }
default_scope lambda { order(:filename) }

attr_accessor :display_date_digitized
validates :digital_provenance, presence: true
Expand All @@ -22,7 +22,7 @@ class DigitalFileProvenance < ActiveRecord::Base
validate :filename_validation
validate :validate_signal_chain

default_scope { order(:filename) }


# File Uses:
# pres for preservation master
Expand Down
2 changes: 1 addition & 1 deletion app/models/machine.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class Machine < ActiveRecord::Base
validates :category, presence: true
validates :serial, presence: true
default_scope {
default_scope lambda {
# FIXME:
# this order interferes with the processing_steps position order, but I think that removing this
# simply results in the order of machines in a device chain being the id order of the machine
Expand Down
2 changes: 1 addition & 1 deletion app/models/processing_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class ProcessingStep < ActiveRecord::Base
validates :machine, presence: true
validates :position, presence: true, numericality: { greater_than: 0 }, uniqueness: { scope: :signal_chain }
validate :validate_format_compatibility
default_scope { order(:signal_chain_id, :position) }
default_scope lambda { order(:signal_chain_id, :position) }

def validate_format_compatibility
if signal_chain && machine
Expand Down
2 changes: 1 addition & 1 deletion app/models/signal_chain.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class SignalChain < ActiveRecord::Base
validates :name, presence: true, uniqueness: true
default_scope { order(:name) }
default_scope lambda { order(:name) }
has_many :processing_steps, dependent: :destroy
has_many :machines, through: :processing_steps
has_many :signal_chain_formats, dependent: :destroy
Expand Down
2 changes: 1 addition & 1 deletion app/models/unit.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Unit < ActiveRecord::Base
default_scope { order(:abbreviation) }
default_scope lambda { order(:abbreviation) }
validates :abbreviation, presence: true, uniqueness: true
validates :name, presence: true, uniqueness: { scope: [:institution, :campus] }

Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class User < ActiveRecord::Base

belongs_to :unit

default_scope { order(:name) }
default_scope lambda { order(:name) }

def self.authenticate(username)
return false if username.nil? || username.blank?
Expand Down
2 changes: 1 addition & 1 deletion app/models/workflow_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class WorkflowStatus < ActiveRecord::Base
XML_EXCLUDE = [:workflow_status_template_id, :physical_object_id, :bin_id, :batch_id, :notes]
include XMLExportModule

default_scope { order(:id) }
default_scope lambda { order(:id) }

belongs_to :workflow_status_template
belongs_to :physical_object
Expand Down