Posted 3 months ago. Visible to the public. Repeats.

Rails: Do not load frameworks you don't need

Rails is split into a large number of (sub-) frameworks.

The most important and central of those are

  • activesupport (extends the Ruby standard library)
  • activerecord / activemodel (ORM for Rails)
  • actionview / actionpack (controller / views)
  • actionmailer (sends mails)

However, there are also some more situational frameworks included, such as

  • actioncable (real time communications using websockets)
  • actionmailbox (receives mails)
  • actiontext (support for WYSIWYG text editor)
  • activejob (background jobs)
  • activestorage (file upload and storage)
  • sprockets (the old "asset pipeline")

You might not need all of these frameworks in every app, so in the interest of startup time and memory usage, you can disable them. To do that, simply comment out the appropriate lines in config/application.rb. You'll also have to remove some configuration options, but you'll receive appropriate error messages.

If your application.rb only has require 'rails/all', you need to replace that line with individual requires for the frameworks you would like to keep.

By refactoring problematic code and creating automated tests, makandra can vastly improve the maintainability of your Rails application.

Owner of this card:

Avatar
Tobias Kraze
Last edit:
3 months ago
by Besprechungs-PC
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Tobias Kraze to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more