Why is Ruby on Rails' default_scope bad?

(Last Updated: 2022-02-10)

A pretty popular opinion in the Ruby on Rails community is that default_scopes should not be used for any reason. However, often it's not fully explained why default_scopes are harmful to applications. Default Scopes are harmful because they are unexpected and hard to unscope.

Solved: ActionController::ParameterMissing (param is missing or the value is empty)

(Last Updated: 2020-01-06)

When using Ruby on Rails' strong_params with require, there is a chance the key doesn't exist. When this happens, an ActionController::ParameterMissing exception is thrown.

Solved: Warning: Using the last argument as keyword parameters is deprecated

(Last Updated: 2020-05-20)

Ruby 2.7 deprecated the use of hashes in the last argument of a method call. Fix this warning by removing the curly braces or adding a hash splat (**) to a variable argument.

Rails: How to Use Greater Than/Less Than in Active Record where Statements

(Last Updated: 2020-01-06)

When querying ActiveRecord for greater than and less than, most people turn to including raw SQL in their codebase... But raw SQL isn't required!