Skip to content

Commit

Permalink
[POD-1795] Add new serialized fields
Browse files Browse the repository at this point in the history
  • Loading branch information
aploshay committed Jul 22, 2022
1 parent f578845 commit 05b6bea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/digital_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ class DigitalStatus < ActiveRecord::Base
require 'json/ext'

serialize :options, Hash
serialize :options_json, JSON
belongs_to :physical_object
validates :physical_object, presence: true
validates :physical_object_mdpi_barcode, presence: true
before_validation :set_mdpi_barcode_from_object

DIGITAL_STATUS_START = "transferred"
serialized_empty_hash = "--- {}\n"
serialized_empty_hash = {}.to_yaml.to_s
# the number of hours after digitization start that a video physical object is auto-accepted
@@Video_File_Auto_Accept = TechnicalMetadatumModule::GENRE_AUTO_ACCEPT_DAYS[:video] * 24
# the number of hours after digitization start that an audio physical object is auto-accepted
Expand Down
1 change: 1 addition & 0 deletions app/models/memnon_invoice_submission.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
class MemnonInvoiceSubmission < ActiveRecord::Base
serialize :problems_by_row
serialize :problems_by_row_json, JSON
validates :filename, presence: true
end
10 changes: 10 additions & 0 deletions db/migrate/20220719160322_add_serialized_fields.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddSerializedFields < ActiveRecord::Migration
def up
add_column :memnon_invoice_submissions, :problems_by_row_json, :text, limit: 4294967295
add_column :digital_statuses, :options_json, :text, limit: 65535
end
def down
remove_column :memnon_invoice_submissions, :problems_by_row_json
remove_column :digital_statuses, :options_json
end
end

0 comments on commit 05b6bea

Please sign in to comment.