{"id":20595508,"url":"https://github.com/thefrontside/activerecord-attributes","last_synced_at":"2026-04-27T05:01:28.678Z","repository":{"id":3835689,"uuid":"4917075","full_name":"thefrontside/activerecord-attributes","owner":"thefrontside","description":"Add simple attribute annotations to your active records","archived":false,"fork":false,"pushed_at":"2016-01-07T02:33:52.000Z","size":6,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-06T15:15:02.367Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"dsherret/lookups","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thefrontside.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-05T23:48:21.000Z","updated_at":"2016-01-07T02:33:53.000Z","dependencies_parsed_at":"2022-07-21T10:32:28.556Z","dependency_job_id":null,"html_url":"https://github.com/thefrontside/activerecord-attributes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/thefrontside/activerecord-attributes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Factiverecord-attributes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Factiverecord-attributes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Factiverecord-attributes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Factiverecord-attributes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thefrontside","download_url":"https://codeload.github.com/thefrontside/activerecord-attributes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thefrontside%2Factiverecord-attributes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32323215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T08:13:20.188Z","updated_at":"2026-04-27T05:01:28.637Z","avatar_url":"https://github.com/thefrontside.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Activerecord::Attributes\n\nJust looking at an ActiveRecord class can be cognitively cumbersome. Not only do you have to comprehend all the\nscopes, relations, validations, etc, present in the file, but at the same time you have mentally\noverlay the database table that it represents in order to get the full picture.\n\nWhy should you required to reconcile two related mental models in realtime in order to comprehend your own, or somebody\nelse's code?\n\n`ActiveRecord::Attributes` is a simple way to annotate and sanity check your record classess so that they can be both\nunderstood and known to be correct.\n\n## Usage\n\nDeclare attributes in your record class\n\n        class Artist \u003c ActiveRecord::Base\n          attribute :name\n          attribute :discipline\n        end\n\nUpon loading this class, the attribute declaration will assert that the columns corresponding to `:name` and\n`:discipline` do indeed exist and fail fast otherwise.\n\nThat's it!\n\n## Migrations\n\nExistential column assertions are all well and good, but in the context of migrations, the columns that back an\nactive record's attributes could be in flux. For this reason, there is the facility to disable sanity checking:\n\n    ActiveRecord::Attributes.without_assertions do\n      Artist.find_by_passion('painting')\n    end\n\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'activerecord-attributes'\n\n\n\n## Code of Conduct\nPlease note that this project is released with a Contributor Code of\nConduct. By participating in this project you agree to abide by its\nterms, which can be found in the `CODE_OF_CONDUCT.md` file in this\nrepository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefrontside%2Factiverecord-attributes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthefrontside%2Factiverecord-attributes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthefrontside%2Factiverecord-attributes/lists"}