{"id":15288749,"url":"https://github.com/jasl-lab/duck_record","last_synced_at":"2025-10-04T18:20:48.015Z","repository":{"id":62557558,"uuid":"84615689","full_name":"jasl-lab/duck_record","owner":"jasl-lab","description":"Used for creating virtual models like ActiveType or ModelAttribute does.","archived":false,"fork":false,"pushed_at":"2018-11-23T20:26:02.000Z","size":196,"stargazers_count":23,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T04:59:20.794Z","etag":null,"topics":["activemodel","activerecord","rails","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasl-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-11T01:47:14.000Z","updated_at":"2019-03-02T22:04:52.000Z","dependencies_parsed_at":"2022-11-03T06:30:30.332Z","dependency_job_id":null,"html_url":"https://github.com/jasl-lab/duck_record","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasl-lab%2Fduck_record","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasl-lab%2Fduck_record/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasl-lab%2Fduck_record/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasl-lab%2Fduck_record/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasl-lab","download_url":"https://codeload.github.com/jasl-lab/duck_record/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674659,"owners_count":21143760,"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","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":["activemodel","activerecord","rails","ruby"],"created_at":"2024-09-30T15:53:03.403Z","updated_at":"2025-10-04T18:20:47.931Z","avatar_url":"https://github.com/jasl-lab.png","language":"Ruby","readme":"Duck Record\n====\n\nIt looks like Active Record and quacks like Active Record, it's Duck Record! \nActually it's extract from Active Record.\n\n## Usage\n\n```ruby\nclass Person \u003c DuckRecord::Base\n  attribute :name, :string\n  attribute :age, :integer\n\n  validates :name, presence: true\nend\n\nclass Comment \u003c DuckRecord::Base\n  attribute :content, :string\n\n  validates :content, presence: true\nend\n\nclass Book \u003c DuckRecord::Base\n  embeds_one :author, class_name: 'Person', validate: true\n  accepts_nested_attributes_for :author\n\n  embeds_many :comments, validate: true\n  accepts_nested_attributes_for :comments\n\n  attribute :title,     :string\n  attribute :tags,      :string,   array:   true\n  attribute :price,     :decimal,  default: 0\n  attribute :meta,      :json,     default: {}\n  attribute :bought_at, :datetime, default: -\u003e { Time.new } \n\n  validates :title, presence: true\nend\n```\n\nthen use these models like a Active Record model,\nbut remember that can't be persisting!\n\n## Installation\n \nSince Duck Record is under early development, \nI suggest you fetch the gem through GitHub. \n \nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'duck_record', github: 'jasl/duck_record'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\nOr install it yourself as:\n```bash\n$ gem install duck_record\n```\n\n## TODO\n\n- refactor that original design for database\n- update docs\n- add useful methods\n- add tests \n- let me know..\n\n## Contributing\n\n- Fork the project.\n- Make your feature addition or bug fix.\n- Add tests for it. This is important so I don't break it in a future version unintentionally.\n- Commit, do not mess with Rakefile or version (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)\n- Send me a pull request. Bonus points for topic branches.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasl-lab%2Fduck_record","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasl-lab%2Fduck_record","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasl-lab%2Fduck_record/lists"}