This file contains hidden or 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 create_session(user) | |
payload = { username_or_email: user.email } | |
if user.two_factor? | |
payload.merge!(auth_code: user.otp_code) | |
else | |
payload.merge!(password: user.password) | |
end | |
post '/sessions', payload | |
error = session[:flash] && session[:flash][:error] |
This file contains hidden or 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 Utilities | |
# Class wrapping Ruby's standard library so as to sniff out date ranges. | |
# | |
class DateParser | |
Error = Class.new(StandardError) | |
RangeParseError = Class.new(Error) | |
DateRangeNotPresent = Class.new(Error) |
This file contains hidden or 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
report: { | |
// Params to filter the results | |
// | |
filters: { | |
date_range: { | |
start: <formatted date String>, // required | |
end: <formatted date String> // optional defaults to today | |
}, | |
matter_types: <Array of ids>, // optional, defaults to array containing all matter types | |
sources: <Array of ids>, // optional, defaults to array containing all sources, |
This file contains hidden or 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
0x07666C5dCdF60c6e837bDfc4f26Ad457e30dfC38 |
This file contains hidden or 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
begin | |
require "bundler/inline" | |
rescue LoadError => e | |
$stderr.puts "Bundler version 1.10 or later is required. Please update your Bundler" | |
raise e | |
end | |
gemfile(true) do | |
source "https://rubygems.org" | |
# Activate the gem you are reporting the issue against. |