This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Inventory | |
NotCheckedInCustomer = Class.new(StandardError) | |
def initialize | |
@customers = [] | |
end | |
Customer = Struct.new(:license_number, | |
:usage_type, | |
:checkin_time, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Original Rails controller and action | |
class EmployeesController < ApplicationController | |
def create | |
@employee = Employee.new(employee_params) | |
if @employee.save | |
redirect_to @employee, notice: "Employee #{@employee.name} created" | |
else | |
render :new | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Billing | |
module Models | |
class BillableEvent < ActiveRecord::Base | |
DrugHealthScreeningDataNotPresent = Class.new(StandardError) | |
acts_as_paranoid | |
belongs_to :event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
class RenameCountiesTable < ActiveRecord::Migration[5.0] | |
def change | |
rename_table :counties, :county_fees | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'sidekiq/testing' | |
RSpec.describe Billing::Workers::SynchronizeCanadaInvoicesMonthlyWorker do | |
subject(:synchronize_invoices_worker) { described_class } | |
before do | |
Sidekiq::Testing.inline! | |
allow(Invoices::Synchronize).to receive(:call) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Billing | |
module Models | |
class InvoiceItem < ActiveRecord::Base | |
extend Memoist | |
include Mixins::Reportable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: 2 | |
jobs: | |
build: | |
parallelism: 4 | |
docker: | |
- image: circleci/ruby:2.5.3-node-browsers | |
environment: | |
MYSQL_PORT: 3306 | |
RACK_ENV: test | |
REDIS_URL: redis://127.0.0.1:6379 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.create_canada_account(payload, client_id) | |
account_id = payload[:account][:checkr_internal_id] | |
client_name = payload[:account][:name] | |
sfdc_id = payload[:account][:sfdc_id] | |
Billing::Models::CanadaAccount.create!( | |
account_id: account_id, | |
client_name: client_name, | |
client_id: client_id, | |
sfdc_id: sfdc_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
module Checkr | |
module Internal | |
class Package < Resource | |
def self.get(package_id) | |
url = "/packages/#{package_id}" | |
key = ['get', url].join(':') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def self.call(payload) | |
new(body: payload).call | |
end | |
def initialize(body:) | |
@body = body | |
end |
NewerOlder