Skip to content

Instantly share code, notes, and snippets.

View LyricL-Gitster's full-sized avatar

Lyric LyricL-Gitster

View GitHub Profile
@LyricL-Gitster
LyricL-Gitster / gist:cb87fb4cad037068657bd1b4412bb907
Last active May 21, 2024 23:36
attr_json Polymorphic validation bug
class BowlerJSON
include AttrJson::Model
attr_json_config bad_cast: :as_nil, unknown_key: :strip
attr_json 'name', :string
validates :name, inclusion: { in: [nil, 'Dude', 'Walter', 'Donnie Who Loved Bowling'] }
end
class LeagueJSON
@LyricL-Gitster
LyricL-Gitster / shoryuken.rb
Created April 30, 2021 19:03
configure Shoryuken with potentially mocked SQS
# initialize moto SQS queue for dev environment
if Rails.env.development?
sqs = Aws::SQS::Client.new(
access_key_id: ENV["AWS_ACCESS_KEY_ID"],
region: ENV["AWS_REGION"],
endpoint: "http://localhost:4576/",
secret_access_key: ENV["AWS_SECRET_ACCESS_KEY"],
verify_checksums: false
)