Skip to content

Instantly share code, notes, and snippets.

@mabenson00
mabenson00 / cheatsheet.rb
Last active May 3, 2024 22:40
Rails ActiveRecord JSON cheatsheet
# Basic key operators to query the JSON objects :
# #> : Get the JSON object at that path (if you need to do something fancy)
# -> : Get the JSON object at that path (if you don't)
# ->> : Get the JSON object at that path as text
# {obj, n} : Get the nth item in that object
# https://www.postgresql.org/docs/9.4/functions-json.html#FUNCTIONS-JSONB-OP-TABLE
# Date
# date before today
@mabenson00
mabenson00 / github-action-artifacts.md
Last active February 10, 2022 20:35
Github Actions: Add failed test screenshots as artifacts

Upload failed test screenshots as Artifacts in Github Actions

If you're running your testing in CI through Github Actions and want to access the screenshots of the failed attempts, here's what you do. This assumes your tests are already set up to run in github actions

Find the path were your test runner is saving screenshots

Look at the the failed test logs in the Github action

Capybara Example: /home/runner/work/company/company/tmp/capybara/