Skip to content

Instantly share code, notes, and snippets.

View fncr-dev's full-sized avatar

Petro Adamovych fncr-dev

View GitHub Profile
@fncr-dev
fncr-dev / orora.md
Last active November 14, 2017 13:24
Optimisation Ruby On Rails Application

Optimisation Ruby On Rails Application

Rails database best practices

Write efficient and chainable scopes:

  • Return an ActiveRecord::Relation.
  • Filter data in the database.
  • Sort in the database.
  • Ordering out of scopes.