Method: ActiveRecord::Snapshot::List.get

Defined in:
lib/active_record/snapshot/files/list.rb

.get(version:) ⇒ Object



21
22
23
24
25
26
27
# File 'lib/active_record/snapshot/files/list.rb', line 21

def get(version:)
  File.readlines(path).each do |line|
    version_str, filename = line.split(" ")
    return [version_str.to_i, filename] if version_str.to_i == version.to_i
  end
  []
end