Skip to content

Instantly share code, notes, and snippets.

@davideghz
Last active April 7, 2020 06:14
Show Gist options
  • Save davideghz/497833f6096a82cea1d310c9c30f919e to your computer and use it in GitHub Desktop.
Save davideghz/497833f6096a82cea1d310c9c30f919e to your computer and use it in GitHub Desktop.
Ruby/Rails Production Checklist

Models

  • Secure models have validations and specs
    • validate presence
    • validate range
  • Secure models have associations and specs
  • Scopes must be tested
  • Provide localization when necessary (Globalize)
  • Implement support for ActiveAdmin's Resource if necessary

Controller

  • Move logic to Services
  • Use Presenters whenever possible
  • If results must be ordered, secure they are ordered under specific conditions (if params[:foo] ...)

DB

  • Commit only schema.rb lines that changed in current pr

ActiveAdmin

  • Remove filters on large tables (users, ...)
  • Explicitly define all actions
  • Do not query large table in form (use field_id or ajax autocompletes)

CodeStyle

  • Avoid unnecessary loops
  • Check the goddamned spaces / blank lines

General

  • Remove all binding.pry
  • Remove commented code blocks
  • Test everything with production data, when possible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment