bogdan/datagrid
61.6
Adequate · 20 September 2026
4.2k
lines of production code
Ruby
primary language
1
measurement over time
What this system is
This system is a Ruby gem that provides a modular, ActiveModel-compatible data grid component for Rails applications. It enables users to define, filter, sort, and display tabular data from various ORM backends, including ActiveRecord, Sequel, Mongoid, and MongoMapper. The library offers a comprehensive suite of filter types, such as ranges and enums, along with modernized view partials and Rails generators to streamline integration and customization.
How it got here
2011 — v2.0 modular architecture rewrite
13 changes.
The project underwent a major architectural refactoring to version 2.0, shifting from a monolithic class to a modular, ActiveModel-compatible design centered on Datagrid::Base. This period involved a complete rewrite of the filter system, ORM drivers, and view layer to support modern Rails and Ruby versions, alongside extensive updates to the test suite and development tooling.
2013–2024 — Datagrid v2 modernization and scaffolding
8 changes.
This period focused on releasing Datagrid v2, which modernized the frontend with new CSS, HTML5 form helpers, and a modular class structure. The update introduced Rails generators to automate grid scaffolding and view customization, supported by comprehensive test coverage and expanded compatibility with Rails 7.0 through 8.1.
Features
Introduce ApplicationGrid base class with helper columns and scaffold templates
A new base class, ApplicationGrid, is now provided in the templates directory to serve as the foundation for generated grids. This base class includes convenience methods for creating date columns (formatted as MM/DD/YYYY) and boolean columns (displayed as Yes/No), and it has forbidden attributes protection disabled by default. Additionally, the scaffold now generates grid classes that inherit from this base, including default filters for ID and date range, and columns for ID, name, and created\_at.
templates · high confidence
New Rails generators for scaffolding grids and copying view partials
The datagrid library now provides two new Rails generators to streamline integration. The \scaffold\ generator (\rails g datagrid::scaffold\) automates the creation of grid classes, controllers, and views, while also handling necessary configuration such as injecting asset imports and adding routing entries. It intelligently supports multiple pagination libraries (Kaminari, Will Paginate, or Pagy) by detecting which are present and generating the appropriate helper code. Additionally, a new \views\ generator (\rails g datagrid::views\) allows users to copy Datagrid's default view partials into their application for customization, excluding the \\_order\_for.html.erb\ partial which is handled differently.
lib/datagrid/generators · high confidence
Architecture
Datagrid v2.0.9 introduces a modular, ActiveModel-compatible architecture
The library has been refactored from a single monolithic class into a modular design centered on \Datagrid::Base\, which composes distinct concerns like \Core\, \Filters\, \Columns\, and \Ordering\ via modules. This change makes the grid fully ActiveModel-compatible by including \ActiveModel::Naming\ and \ActiveModel::AttributeAssignment\, enabling seamless integration with Rails form builders and URL parameter handling. The update also introduces a global \Datagrid.configure\ API for setting date and timestamp formats, adds a \ColumnNamesAttribute\ module for dynamic column visibility filtering, and extracts the Rails integration into a dedicated \Engine\ module.
lib/datagrid · high confidence
Behavioural changes
Complete rewrite of the filter system with new filter types and range support
The filter implementation in lib/datagrid/filters has been completely rewritten, replacing the previous architecture with a new class hierarchy. This introduces dedicated filter classes for Boolean, Date, DateTime, Default, Dynamic, Enum, ExtendedBoolean, Float, Integer, String, and a base RangedFilter module. Key behavioral changes include native support for range filters (via :range option) for numeric, date, and string types, allowing users to filter by value intervals. The DynamicFilter now uses a Hash-based structure for field, operation, and value, supporting customizable operations (=, =\~, \>=, \<=) and explicit type casting. Enum filters now support checkbox selection (:checkboxes option) and proc-based select definitions. Input types are automatically set to HTML5 standards (e.g., 'date', 'datetime-local', 'number') where appropriate, and boolean filters treat true/false strings as YES/NO values.
lib/datagrid/filters · high confidence
Datagrid v2: Modernized views, form helpers, and CSS classes
Version 2 introduces significant frontend and API changes to align with modern Rails and HTML5 standards. The default form helper has migrated from \form\_for\ to \form\_with\, and the \column\[url\]\ option is removed in favor of a flexible formatting layer. CSS classes have been renamed to follow modular naming conventions (e.g., \filter\ to \datagrid-filter\), and range filters now use native HTML5 input types with consistent \label\[for\]\ and \input\[id\]\ attributes. Additionally, grids should now inherit from \Datagrid::Base\ instead of including the \Datagrid\ module, and the \datagrid\_order\_for\ helper is deprecated.
version-2 · high confidence
Datagrid views refactored into explicit partials with modernized HTML structure
The datagrid view layer has been restructured into a set of dedicated ERB partials (\_form, \_head, \_row, \_table, \_dynamic\_filter, \_enum\_checkboxes, \_range\_filter, \_order\_for) that replace the previous implicit rendering logic. This change introduces a consistent HTML structure using explicit thead/tbody sections, applies data attributes (data-column, data-filter, data-type) for better frontend targeting, and exposes specific CSS classes (e.g., datagrid-order-active-asc/desc, datagrid-dynamic-field) to support modern CSS modular frameworks. Users will see improved accessibility with correct label/input associations, consistent class naming, and a standardized form structure using form\_with.
app/views · high confidence
Deprecate column\[class\] in favor of tag\_options
The \class\ option for columns is now deprecated; users should migrate to the \tag\_options\ hash (e.g., \tag\_options: { class: '...' }\). The library now automatically migrates existing \class\ values to \tag\_options\ at initialization while emitting a deprecation warning, ensuring backward compatibility during the transition.
lib/datagrid/columns · high confidence
Deprecation of module inclusion in favor of class inheritance
The library now requires users to inherit from \Datagrid::Base\ instead of including the \Datagrid\ module. The previous \included\ hook has been updated to emit a deprecation warning and continue functioning for backward compatibility, but users are encouraged to migrate to the new inheritance-based approach to ensure future compatibility.
lib · high confidence
New CSS styles for the data grid component
A new stylesheet (datagrid.css) has been added to define the visual appearance of the data grid, including table layout, filter forms, dynamic field inputs, enum checkboxes, and action buttons.
app/assets · high confidence
Repository tooling and configuration overhaul
The project has replaced the Jeweler gem with standard Bundler and Rake tasks for gem management, removed the RDoc generation task in favor of YARD (evidenced by the new .yardopts and .rubocop.yml requiring rubocop-yard), and migrated documentation from RDoc to Markdown. The Appraisals file has been updated to test against Rails 7.0 through 8.1 and Ruby 3.4, while the .gitignore has been cleaned up to exclude modern build artifacts and lockfiles.
(repo-wide) · high confidence
Rewritten ORM drivers with a unified abstract interface
The data grid's backend drivers for ActiveRecord, Sequel, Mongoid, and MongoMapper have been refactored into separate classes inheriting from a new AbstractDriver. This change introduces a standardized API for data operations (such as filtering, sorting, and batch processing) across all supported ORMs, ensuring consistent behavior and improving maintainability. Users will benefit from more robust handling of column types, automatic association preloading, and fixed issues with batch exports and ordering across different database backends.
lib/datagrid/drivers · high confidence
Test coverage
Added comprehensive test suite for Datagrid core components; Added namespaced and custom datagrid test partials; Added test coverage for ORM and array data grid drivers; Added test coverage for datagrid filter components; Added test support infrastructure for ORM drivers and matchers; Added tests for column inspection and default option inheritance; Added tests for the Datagrid scaffold generator; Updated test suite and spec helper configuration.
Dependencies
Add Appraisal gemfiles for Rails 7.0 through 8.1
The gemfiles directory now includes dedicated Appraisal configuration files for Rails versions 7.0, 7.1, 7.2, 8.0, and 8.1. This enables the library to be tested against these specific Rails releases, with corresponding updates to the sqlite3 gem version (1.7.0 for 7.0/7.1, 2.0.0 for 7.2, and 2.1.0 for 8.0/8.1) and the inclusion of a pre-release constraint for Rails 8.1.
gemfiles · high confidence
Update gemspec and development dependencies for Ruby 3.0+ and Rails 7.0+
The gemspec now requires Ruby 3.0 or higher and adds a runtime dependency on Railties 7.0 or newer. Development dependencies have been refreshed to support modern tooling: the project now uses the \debug\ gem instead of older debuggers, includes \rubocop\ for linting, and adds \rails-dom-testing\ for HTML testing. Additional development gems like \activerecord\, \sequel\, \sqlite3\, and \mongoid\ are explicitly listed to support testing against multiple data stores.
(dependencies) · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 62.
Lenses
- Code Health 98
- Architecture 97
- Maturity 57
- Readiness 58
- Security 76
- Accessibility 57
Changes since last survey
- 300 commits — 264 feature/other, 36 fixes
By area
- lib/datagrid — 114 commits
- (root) — 53 commits
- spec/datagrid — 32 commits
- (repo) — 26 commits
- app/views — 25 commits
- version-2/Readme.markdown — 14 commits
- version-2/views.diff — 11 commits
- app/assets — 10 commits
- .github/workflows — 6 commits
- spec/spec_helper.rb — 2 commits
- version-2/form-v1.html — 2 commits
- gemfiles/rails_8.0.gemfile — 1 commit
- lib/datagrid.rb — 1 commit
- spec/datagrid_spec.rb — 1 commit
- version-2/find_broken_range_filters.rb — 1 commit
- version-2/form-v2.html — 1 commit
Notable commits
- fix: Fix #as_query to provide format ready to convert to URL params
- fix: Fix NameError raised with empty dynamic fields (#350)
- fix: Fix README.md typo in view generator script (#337)
- fix: Fix assignment hash value with string keys to range filter
- fix: Fix build
- fix: Fix build for older ruby
- fix: Fix build for ruby 3.0
- fix: Fix build ruby 3.0 rails 7.2 8.0
- fix: Fix changelog
- fix: Fix changelog url
- fix: Fix ci status icon
- fix: Fix dynamic filter layout
- fix: Fix dynamic filter when assigned a hash with string keys
- fix: Fix enum checkboxes label width
- fix: Fix generator. #336
- fix: Fix inheriting default column options (#338)
- fix: Fix meta methods doc
- fix: Fix migration guide. Fixes #329
- fix: Fix nil value for date/time input
- fix: Fix ordering of Hashes
- …and 280 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
bogdan/datagrid was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit d36ecf07e13e5d599084ab956a806383d4a03931 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.