A collection of awesome ActiveRecord goodies, libraries, tools, extensions, guides, etc.
Switch branches/tags
Nothing to show
Clone or download
Latest commit 2e77c35 Apr 3, 2018
Permalink
Failed to load latest commit information.
README.md Add Discard to Soft Deletion category Apr 4, 2018

README.md

Awesome Series @ Planet Ruby

Rubies (Virtual Machines, Compilers, ...)ActiveRecordWebframeworks (Micro, Macro, APIs, ...)Events (Conferences, Camps, Meetups, ...)Blogs (News, Opinions, Podcasts, ...)

ActiveRecord

A collection of awesome ActiveRecord goodies, libraries, tools, extensions, guides, etc.


[ANNOUNCEMENT] Looking for awesome world data (countries, cities, flags, languages, currencies, etc.)? See the Awesome World List @ Planet Open Data.


Contributions welcome. Anything missing? Send in a pull request. Thanks.

Note: ㊗️ stands for the Gem of the Week article in the Gem of the Week Series @ Planet Ruby.

ActsAsList - SortableActsAsTree - Hierarchy / NestedActsAsTaggable - Tags & Taggings, Categories & CategorizationsDate / Time

ActiveRecord HQ

  • ActiveRecord (gem: activerecord, github: rails/rails/activerecord)
    • 2014: 4.2.0 (Dec/20); 4.1.0 (Apr/8) ++ 2013: 4.0.0 (Jun/25) ++ 2012: 3.2.0 (Jan/20) ++ 2011: 3.1.0 (Aug/31) ++ 2010: 3.0.0 (Aug/29) ++ 2007: 2.0.0 (Dec/6) ++ 2004: 1.0.0 (Oct/25)

Documentation

Rails Guides Series

ActsAsList - Sortable

ActsAsTree - Hierarchy / Nested

ActsAsTaggable - Tags & Taggings, Categories & Categorizations

Date / Time

  • ByStar (gem: by_star, github: radar/by_star) - easily and reliably query ActiveRecord objects based on time e.g. by_year, yesterday, before( Date.today )
  • Season (gem: season, github joaodiogocosta/season) - automatically creates scopes for ActiveRecord date, datetime and timestamp attributes
  • Groupdate (gem: groupdate, github: ankane/groupdate) - easily and reliably group ActiveRecord objects based on time e.g. day, week, hour of the day and more; has time zone support

Attachments

Default Values

Validations

Pagination

  • Kaminari (gem: kaminari, github: amatsuda/kaminari) - a scope and engine based, clean, powerful, customizable and sophisticated paginator
  • will_paginate (gem: will_paginate, github: mislav/will_paginate) - a pagination library
  • order_query (gem: order_query, github: glebm/order_query) - uses no offset; finds the next or previous record(s) relative to the current one efficiently using keyset pagination, e.g. for navigation or infinite scroll

ActsAsVersioned - Versioning / Auditing

ActsAsParanoid - Soft Delete / Keep Deleted Records

  • Paranoia :octocat:, 💎 - a re-implementation of acts_as_paranoid
  • ActsAsParanoid :octocat:, 💎 - soft delete; hide records instead of deleting them, making them recoverable later
  • PermanentRecords :octocat:, 💎 - soft-delete your ActiveRecord records; it's like an explicit version of ActsAsParanoid
  • DestroyedAt :octocat:, 💎 - ActiveRecord mixin for safe destroys
  • Immortal :octocat:, 💎 - make any ActiveRecord model paranoid by just including Immortal, and instead of being deleted from the database, the object will just marked as deleted with a boolean field in the database
  • ActsAsArchive :octocat:, 💎 - don't delete your records, move them to a different table
  • SoftDeletion :octocat:, 💎 - adds a new soft_delete method with callbacks and dependents support
  • Discard :octocat:, 💎 - "Soft deletes for ActiveRecord done right"

ActsAsStateMachine - State Machines

Search

Query Builder

  • BabySqueel :octocat:, 💎 - an expressive query DSL for Active Record 4 and 5
  • Squeel :octocat:, 💎 - lets you write your Active Record queries with fewer strings, and more Ruby

Dynamic Attributes

  • dynabute, 💎 - dynamically add attributes on ActiveRecord without hash serialization
  • dynamic_attributes, :gem" - lets you dynamically specify attributes on ActiveRecord models

Geocoding

  • Geocoder :octocat:, 💎 - lookup latitude/longitude based on an address defined in your model or an IP address; search for nearby locations

Multi Tenancy

Performance / Profiling / Debugging

  • Bullet :octocat:, 💎 - help to kill N+1 queries and unused eager loading
  • Goldiloader :octocat:, 💎 - automatically eager loads associations as they're traversed (helping to avoid N+1 queries)
  • marginalia :octocat:, 💎 - attach comments to your ActiveRecord queries; helps when searching log files for queries, and seeing where slow queries came from

Seeds / Data Migrations

  • SeedMigration :octocat:, 💎 - a way to manage changes to seed data similar way to how schema migrations are handled

Bulk / Batch Importer

ActiveRecord and PostgreSQL

  • ActiveRecord and PostgreSQL @ Rails Guides - PostgreSQL specific usage of Active Record (e.g. use PostgreSQL's datatypes - hstore, json, array etc.; use UUID primary keys; use full text search with PostgreSQL and more)

Arel / A Relational Algebra / Arel Really Exasperates Logicians

  • Arel Gem 💎, :octocat: - a SQL AST manager for Ruby; simplifies the generation of complex SQL queries and adapts to various SQL flavors

Documentation

Database Browser

  • dbbrowser :octocat:, 💎 - database browser (connections, schema, tables, records, etc.) as mountable web app
  • rails_db :octocat:, 💎 - Rails database viewer and SQL Query runner in browser

Database Admin / Scaffold

Text-to-SQL

  • ㊗️ Datapak :octocat:, 💎 - a library to work with tabular data packages (*.csv files w/ datapackage.json) in SQL via ActiveRecord
  • data_miner :octocat:, 💎 - download, pull out of a ZIP/TAR/GZ/BZ2 archive, parse, correct, and import XLS, ODS, XML, CSV, HTML, etc. into your ActiveRecord models

Schema Documentation / Annotations / Diagrams

Schema Extensions

  • SchemaPlus :octocat:, 💎 - foreign key constraints, indexes, (auto-)validations and much more

Ready-to-Use (Instant) Models / Schemas

Misc

Databases

SQLite

MySQL / MariaDB

Datasets / Plain Text Fixtures

Alternatives

More Object-relational (O/R) mapping libraries

Thanks

Jacob Burenstam • Ian Irving • Scott P • Joel Turkel

Meta

License

The awesome list is dedicated to the public domain. Use it as you please with no restrictions whatsoever.

Questions? Comments?

Send them along to the ruby-talk mailing list. Thanks!