Skip to content
Back to skills

Rails

ASecurity

Build reliable Rails apps avoiding ActiveRecord traps, N+1 queries, and callback pitfalls.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 11, 2026
toolssqlrailssecurity

Security analysis

A100/100

Pro scans all 8 files and shows the line behind each finding

Scanned November 11, 2026

npx -y skills add johnalbertini14-glitch/openclaw-skills --skill rails --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Rails?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Rails
[![Security: A β€” Skills Directory](https://www.skillsdirectory.com/api/skills/johnalbertini14-glitch-rails/badge)](https://www.skillsdirectory.com/skills/johnalbertini14-glitch-rails)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Rails
slug: rails
version: 1.0.1
description: Build reliable Rails apps avoiding ActiveRecord traps, N+1 queries, and callback pitfalls.
metadata: {"clawdbot":{"emoji":"πŸ›€οΈ","requires":{"bins":["rails"]},"os":["linux","darwin","win32"]}}
---

## Quick Reference

| Topic | File |
|-------|------|
| N+1, callbacks, validations, scopes | `activerecord.md` |
| Strong params, filters, render | `controllers.md` |
| Route conflicts, constraints | `routing.md` |
| Partials, helpers, caching, XSS | `views.md` |
| ActiveJob, Sidekiq, retries | `jobs.md` |
| Mass assignment, CSRF, SQL injection | `security.md` |

## Critical Rules

- `save` returns false on failure β€” `save!` raises, check return or use bang
- `update_all`/`delete_all` skip callbacks and validations β€” data corruption if unaware
- `find_each` for batches β€” `Model.all.each` loads entire table into memory
- `redirect_to` doesn't halt execution β€” code after it runs, use `and return`
- `dependent: :destroy` missing β€” orphan records accumulate forever
- `default_scope` pollutes all queries including joins β€” almost always wrong
- Callbacks chain silently β€” `throw :abort` stops save but returns false, not exception
- `includes` without `references` in `where` string β€” N+1 still happens
- `||=` memoization caches nil/false β€” use `defined?(@var) ? @var : @var = compute`
- `has_many through:` vs `has_and_belongs_to_many` β€” latter has no join model for attrs
- Nested `before_action` β€” multiple inheritance makes flow unreadable
- `render` doesn't stop action β€” code continues, duplicate render crashes

Files in this skill

  • SKILL.md1.6 KB
  • _meta.json445 B
  • activerecord.md879 B
  • controllers.md599 B
  • jobs.md483 B
  • routing.md549 B
  • security.md570 B
  • views.md587 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools β†’

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.