{"id":18785652,"url":"https://github.com/dbackowski/active_record-default_values","last_synced_at":"2026-06-14T21:32:05.873Z","repository":{"id":32830611,"uuid":"36423681","full_name":"dbackowski/active_record-default_values","owner":"dbackowski","description":"Add default values to Active Record models.","archived":false,"fork":false,"pushed_at":"2015-06-02T12:40:32.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-05-03T18:07:22.201Z","etag":null,"topics":["activerecord","default-value","rails","ruby"],"latest_commit_sha":null,"homepage":null,"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/dbackowski.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":"2015-05-28T08:01:55.000Z","updated_at":"2015-05-28T08:04:44.000Z","dependencies_parsed_at":"2022-09-05T16:10:29.471Z","dependency_job_id":null,"html_url":"https://github.com/dbackowski/active_record-default_values","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/dbackowski/active_record-default_values","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Factive_record-default_values","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Factive_record-default_values/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Factive_record-default_values/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Factive_record-default_values/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dbackowski","download_url":"https://codeload.github.com/dbackowski/active_record-default_values/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dbackowski%2Factive_record-default_values/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34339194,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-14T02:00:07.365Z","response_time":62,"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","default-value","rails","ruby"],"created_at":"2024-11-07T20:49:15.232Z","updated_at":"2026-06-14T21:32:05.854Z","avatar_url":"https://github.com/dbackowski.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ActiveRecord::DefaultValues [![Build Status](https://travis-ci.org/dbackowski/active_record-default_values.svg?branch=master)](https://travis-ci.org/dbackowski/active_record-default_values)\n\nAdd default values to Active Record models.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'active_record-default_values'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install active_record-default_values\n\n## Usage\n\n```ruby\nclass User \u003c ActiveRecord::Base\n  default_value :first_name, 'John'\n  default_value :last_name, 'Doe'\n  default_value :active, false\n  default_value :add_time, -\u003e { Time.now }\n  default_value :age, 20\n  default_value :description, 'Test', if: :blank?\nend\n\nUser.new(first_name: 'Samwise', description: '')\n\n=\u003e #\u003cUser id: nil, first_name: \"Samwise\", last_name: \"Doe\", add_time: \"2015-05-27 15:35:32\", active: false, age: 20, description: \"Test\"\u003e\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/dbackowski/active_record-default_values/fork )\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 a new Pull Request\n\nCopyright (c) 2015 [Damian Baćkowski], released under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackowski%2Factive_record-default_values","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdbackowski%2Factive_record-default_values","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdbackowski%2Factive_record-default_values/lists"}