{"id":16071779,"url":"https://github.com/ioquatix/activerecord-configurations","last_synced_at":"2025-09-11T15:30:54.282Z","repository":{"id":29886956,"uuid":"123078161","full_name":"ioquatix/activerecord-configurations","owner":"ioquatix","description":"Manage multiple databases in Rails 5 and Rails 6 with elegance.","archived":false,"fork":false,"pushed_at":"2022-06-02T01:06:53.000Z","size":20,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-03T19:06:56.545Z","etag":null,"topics":["activerecord","extension","gem","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ioquatix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T05:35:27.000Z","updated_at":"2024-09-03T13:15:18.000Z","dependencies_parsed_at":"2022-08-30T02:33:20.824Z","dependency_job_id":null,"html_url":"https://github.com/ioquatix/activerecord-configurations","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/ioquatix/activerecord-configurations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioquatix%2Factiverecord-configurations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioquatix%2Factiverecord-configurations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioquatix%2Factiverecord-configurations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioquatix%2Factiverecord-configurations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ioquatix","download_url":"https://codeload.github.com/ioquatix/activerecord-configurations/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ioquatix%2Factiverecord-configurations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274660038,"owners_count":25326119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-11T02:00:13.660Z","response_time":74,"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":["activerecord","extension","gem","ruby"],"created_at":"2024-10-09T07:42:07.388Z","updated_at":"2025-09-11T15:30:54.007Z","avatar_url":"https://github.com/ioquatix.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveRecord::Configurations\n\nThis gem replaces the default ActiveRecord configurations system which typically involves a YAML file.\n\n[![Build Status](https://secure.travis-ci.org/ioquatix/activerecord-configurations.svg)](http://travis-ci.org/ioquatix/activerecord-configurations)\n[![Code Climate](https://codeclimate.com/github/ioquatix/activerecord-configurations.svg)](https://codeclimate.com/github/ioquatix/activerecord-configurations)\n[![Coverage Status](https://coveralls.io/repos/ioquatix/activerecord-configurations/badge.svg)](https://coveralls.io/r/ioquatix/activerecord-configurations)\n\n## Motivation\n\nThe standard YAML file technique of specifying database configurations is cumbersome at best, and really only works well for a single database connection: there is no isolation between different sets of connections, and it's not possible to specify multiple `DATABASE_URL` values.\n\nWe needed something to streamline and minimize the amount of configuration in this sensitive area of deployment. Making a mistake in a production system is a big problem. This is achieved by testing and convention over configuration.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'activerecord-configurations'\n```\n\n## Usage\n\nAdd something like this to `db/environment.rb`\n\n```ruby\nrequire 'active_record/configurations'\n\nclass ActiveRecord::Base\n\textend ActiveRecord::Configurations\n\t\n\tconfigure(:production) do\n\t\tprefix 'library'\n\t\tadapter 'postgres'\n\tend\n\n\tconfigure(:development, parent: :production)\nend\n\n# pp ActiveRecord::Base.configurations\n```\n\nThis will setup the `development` and `production` configurations, which can be overridden by specifying the `LIBRARY_DSN` environment variable.\n\n### Multiple Databases\n\nYou can easily have more than one database connection.\n\n```ruby\nclass UsersModel \u003c ActiveRecord::Base\n\tself.abstract_class = true\n\t\n\textend ActiveRecord::Configurations\n\t\n\tconfigure(:production) do\n\t\tprefix 'users'\n\t\tadapter 'mysql2'\n\tend\n\n\tconfigure(:development, parent: :production)\nend\n\n# pp UsersModel.configurations\n\nclass User \u003c UsersModel\n\t# ...\nend\n```\n\nAs this has a different prefix, the connection can be overridden by specifying `USERS_DSN`.\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## See Also\n\n- [ActiveRecord::Rack](https://github.com/ioquatix/activerecord-rack)\n- [ActiveRecord::Migrations](https://github.com/ioquatix/activerecord-migrations)\n\n## License\n\nReleased under the MIT license.\n\nCopyright, 2018, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioquatix%2Factiverecord-configurations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fioquatix%2Factiverecord-configurations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fioquatix%2Factiverecord-configurations/lists"}