brew services stop postgresql@14
brew install postgresql@15
brew services stop postgresql@15
- optionally add --check argument to test upgradability between versions
def check_for_old_dependencies | |
outdated_gems = list_gems | |
parsed_gems = parse_outdated_gems outdated_gems | |
results = check_age parsed_gems | |
ordered = results.sort_by { |gem| gem[1] } | |
File.open('results.json', 'w') { |f| f.write JSON.dump(ordered) } | |
print_results ordered | |
end | |
def list_gems |
# Custom search ransacker | |
# models/concerns/ransackers | |
module Ransackers | |
module Candidate | |
extend ActiveSupport::Concern | |
included do | |
ransacker :candidate_approved_at, | |
formatter: proc { |date| |
module Test | |
def self.iterate(array) | |
Hash.new(0).tap do |result| | |
array.each do |hash| | |
hash.each do |key, val| | |
result[key] = result[key] + val | |
end | |
end | |
end | |
end |
a = [ | |
{ entity: [1, 2], other: 1 }, | |
{ entity: [2, 3], other: 3 } | |
] | |
def copy_examples_to_entities(array_of_examples) | |
array_of_examples.map do |example| | |
entities = example[:entity] | |
if entities.count > 1 |
# based on https://k3a.me/mod11.php | |
# limited to 10 digit account numbers | |
module RandomAccountGenerator | |
WEIGHT = [1, 2, 4, 8, 5, 10, 9, 7, 3, 6].reverse.freeze | |
class << self | |
def call | |
loop do | |
account_number = guess_number |
class AddFieldsToDelayedJobs < ActiveRecord::Migration | |
def change | |
add_column :delayed_jobs, :signature, :string, index: true | |
add_column :delayed_jobs, :args, :text | |
end | |
end |