rails/rails
By the numbers
A quantitative snapshot of the rails/rails repo. Data collected on 2026-04-30 against main at commit 0e53474dd25bb06cc87c07a75ffec49d3490152c.
Size
The repo is dominated by Active Record, Active Support, and Action Pack. Counts below are lines in lib/ only (production Ruby), excluding test/, generators, and templates.
xychart-beta horizontal
title "Lines of Ruby in lib/ per component"
x-axis ["actioncable", "actionmailbox", "actionmailer", "actionpack", "actiontext", "actionview", "activejob", "activemodel", "activerecord", "activestorage", "activesupport", "railties"]
y-axis "Lines"
bar [4198, 728, 2755, 28574, 2580, 19401, 4743, 9017, 69692, 3904, 32407, 15862]| Component | lib/ lines |
Notes |
|---|---|---|
activerecord |
69,692 | The ORM dominates — ~33% of all production Ruby |
activesupport |
32,407 | Core extensions plus pub/sub, cache, current attributes, etc. |
actionpack |
28,574 | Action Controller + Action Dispatch combined |
actionview |
19,401 | Templates and helpers |
railties |
15,862 | CLI, generators, application boot |
activemodel |
9,017 | Validations, callbacks, dirty tracking |
activejob |
4,743 | Background jobs |
actioncable |
4,198 | WebSockets |
activestorage |
3,904 | File uploads |
actionmailer |
2,755 | Outbound email |
actiontext |
2,580 | Rich text |
actionmailbox |
728 | Inbound email |
Total lib/ |
193,861 |
Including tests (test/), the repo contains ~395,000 lines of Ruby and ~1,260 *_test.rb files.
File counts (Ruby + ERB + JS + Markdown)
Top-level directories ranked by source files:
| Directory | Files |
|---|---|
activerecord/ |
1,144 |
activesupport/ |
517 |
actionview/ |
500 |
actionpack/ |
449 |
railties/ |
358 |
activestorage/ |
183 |
activemodel/ |
156 |
activejob/ |
136 |
actiontext/ |
135 |
actioncable/ |
115 |
guides/ |
113 |
actionmailer/ |
111 |
actionmailbox/ |
104 |
tools/ |
60 |
Activity
- Total commits on
main: 97,490 - First commit: 24 November 2004 ("Initial")
- Latest commit (at snapshot): 30 April 2026 (Tokyo time)
- Commits in the last 12 months: ~6,047
- Commits in the last 24 months: ~9,400+
- Commits in 2024: 4,012
- Commits in 2025 (YTD): 3,297
The codebase has averaged roughly 4,000-5,000 commits per year for several years running, with a long-term mean closer to ~4,500/year over the project's lifetime.
Most active components in the last 12 months (by commits)
Rough commit count for changes touching each component (last 12 months):
| Component | ~Commits |
|---|---|
activerecord |
700+ |
activesupport |
400+ |
actionview |
300+ |
actionpack |
300+ |
railties |
200+ |
activejob |
120+ |
Active Record is consistently the most-changed component, reflecting the ongoing work on adapters, encryption, multi-DB, and async queries.
Bot-attributed commits
Searching git log for Co-authored-by: lines mentioning common bot accounts (dependabot[bot], github-actions[bot], factory-droid[bot], etc.) yields a very small number of commits — well under 1% of the total. Rails is overwhelmingly authored by humans. This is a lower bound on AI-assisted work since inline AI tools like Copilot leave no co-author trace.
Largest source files
| File | Lines |
|---|---|
actionpack/test/dispatch/routing_test.rb |
5,343 |
railties/test/application/configuration_test.rb |
5,308 |
actionview/test/template/form_helper_test.rb |
4,300 |
actionview/test/template/date_helper_test.rb |
3,710 |
activerecord/test/cases/associations/has_many_associations_test.rb |
3,353 |
activerecord/test/cases/relations_test.rb |
2,796 |
actionview/lib/action_view/helpers/form_helper.rb |
2,766 |
actionview/test/template/form_with_test.rb |
2,553 |
The longest production file is actionview/lib/action_view/helpers/form_helper.rb at 2,766 lines — Rails' form-builder DSL has accumulated 20 years of helpers.
TODO/FIXME/HACK
A grep of *.rb for TODO|FIXME|HACK:
- Files containing at least one comment: 56
- Total comments: 131
A modest number for a 200K-line codebase, but worth a tour. See how-to-contribute/patterns-and-conventions for how the codebase tends to handle these.
Releases
The release tag history (most recent first):
v8.1.3, v8.1.2.1, v8.1.2, v8.1.1, v8.1.0,
v8.0.5, v8.0.4.1, v8.0.4, ...Active maintenance branches at the time of writing: 8.1-stable, 8.0-stable, 7.2-stable, 7.1-stable, plus main (8.2.0.alpha).
Test-to-code ratio
Counting *_test.rb files alone: 1,262 test files vs ~3,400 Ruby source files in lib/ directories — roughly 1 test file for every 2.5 source files. By line count, test/ outweighs lib/ (the repo total is ~395K Ruby lines vs ~194K in lib/), giving a test-to-code ratio of approximately 1.0+ for tests vs. production code.
Dependencies
- The top-level
Gemfiledeclares ~50 direct dev dependencies (databases, integration gems, dev tools). - The
Gemfile.lockresolves to ~1,000 lines of dependencies. - The 12 component gemspecs collectively declare ~25 runtime dependencies (Rack, Loofah, Mail, Marcel, Nokogiri, Tzinfo, etc.).
For more, see reference/dependencies.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.