A Ruby gem that extends Arel with shortcuts, fixes, and new ORM mappings for advanced SQL functions across multiple databases.
Arel Extensions is a Ruby gem that extends the Arel library, which is used by ActiveRecord for building SQL queries. It adds shortcuts, fixes, and new ORM mappings to support advanced SQL functions—like mathematical operations, string manipulations, and date/time handling—across multiple databases. It solves the problem of writing database-specific SQL by providing a pure Ruby syntax for complex queries.
Ruby on Rails developers who need to write complex, database-agnostic SQL queries using ActiveRecord and Arel, especially those working with multiple RDBMS like MySQL, PostgreSQL, or SQL Server.
Developers choose Arel Extensions because it allows them to use advanced SQL features directly in Ruby code without dropping down to raw SQL, ensuring portability across databases and maintaining the elegance of ActiveRecord's query interface.
Extending Arel
Supports MySQL, PostgreSQL, SQLite, Oracle, MS SQL Server, and DB2 with automatic SQL adaptation, as shown in the comprehensive function table, ensuring portability across systems.
Enables natural Ruby expressions like `t[:nb].sum + 42` to generate SQL, bridging the gap between Ruby's expressiveness and SQL's power without dropping to raw SQL.
Adds support for advanced mathematical, string, date/time, and comparator operations (e.g., REGEXP, DATEADD, bulk_insert) directly in Arel, simplifying complex query building.
Provides `bulk_insert` for efficient multi-row inserts and uses Ruby operators like `+` for UNION operations, streamlining data manipulation tasks.
The README warns that time zone names are RDBMS-specific, SQL Server has its own conventions, and daylight saving management varies, requiring extensive testing and careful implementation.
Some functions like POSIX formatting aren't implemented for all databases (e.g., DB2), and others rely on database extensions or fallbacks, limiting true universality.
Requires calling `add_sql_functions()` after database connection for full features, and version compatibility depends on Rails/Arel updates, adding complexity to deployment.
Track changes to your rails models
A tagging plugin for Rails applications that allows for custom tagging along dynamic contexts.
Organise ActiveRecord model into a tree structure
Audited (formerly acts_as_audited) is an ORM extension that logs all changes to your Rails models.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.