Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
machinehum committed Oct 25, 2023
1 parent d52ed71 commit 4a53ca8
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions app/models/trial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,6 @@ class Trial < ApplicationRecord

scope :recent_as, ->(duration){ where('updated_at > ?', Time.zone.today - duration ).order('updated_at DESC') }

def self.update_irb_numbers
CSV.foreach("lib/irb_numbers.csv", headers: true) do |row|
old_irb = row[1]
new_irb = row[2]
trial = Trial.find_by(system_id: old_irb)
next if trial.blank?
p "#{trial.id}: #{trial.system_id} will change to #{new_irb}"
trial.update(system_id: new_irb, irb_number: new_irb)
end
end

def self.import_from_file(file)
CSV.foreach(file.path, headers: true) do |row|
Trial.create! row.to_hash
Expand Down

0 comments on commit 4a53ca8

Please sign in to comment.