{"id":19156279,"url":"https://github.com/ess/collectable","last_synced_at":"2025-02-22T21:42:03.138Z","repository":{"id":21726907,"uuid":"25048573","full_name":"ess/collectable","owner":"ess","description":"Make PORO models work with collection_check_boxes","archived":false,"fork":false,"pushed_at":"2014-10-11T22:42:24.000Z","size":160,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"develop","last_synced_at":"2025-02-04T00:06:29.490Z","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":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ess.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":"2014-10-10T18:46:14.000Z","updated_at":"2014-11-17T22:59:56.000Z","dependencies_parsed_at":"2022-08-17T16:25:28.931Z","dependency_job_id":null,"html_url":"https://github.com/ess/collectable","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fcollectable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fcollectable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fcollectable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ess%2Fcollectable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ess","download_url":"https://codeload.github.com/ess/collectable/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240241802,"owners_count":19770463,"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":[],"created_at":"2024-11-09T08:33:58.281Z","updated_at":"2025-02-22T21:42:03.120Z","avatar_url":"https://github.com/ess.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Collectable ##\n\nSo, I serialize stuff into arrays in my AR objects where it doesn't make\nsense to go through the rigamaroe of actually making an empty AR model\nto use for the association. This is just a bit of glue to make using\nthat pattern a bit easier with \n\nThere's not much to this thing, and what's there exists only to serve the\nneeds that I've had for this sort of thing.\n\nThat said, pull requests are totally welcome :)\n\n## Gem Setup ##\n\n```ruby\ngem install collectable\n\n# Gemfile\ngem 'collectable'\n```\n## Basic usage ##\n\nThe short version is \"include the module and define some characteristics.\"\nThat's also the long version, as it were.\n\n```ruby\nclass HairColor\n  include Collectable\n\n  characteristic :blonde\n  characteristic :brown\n  characteristic :red\n  characteristic :black\n  characteristic :purple\n  characteristic :tie_dye\nend\n```\n\nThen, to actually use the thing, do something like this in your view:\n\n```erb\n\u003c%= form_for @person do |f| %\u003e\n  \u003c%= f.collection_check_boxes(:hair_color, HairColor.collected, HairColor.value, HairColor.name) %\u003e\n\u003c% end %\u003e\n```\n\n## Contributing ##\n\nDo you use git-flow? I sure do. Please base anything you do off of\n[the develop branch](https://github.com/ess/collectable/tree/develop).\n\n1. Fork it.\n2. Perform some BDD magic. Seriously. Be testing.\n3. Submit a pull request.\n\n## History ##\n\n* 0.0.4 - Renamed \"traits\" to \"characteristics\"\n* 0.0.3 - .value and .name actually added\n* 0.0.2 - Renamed collected_item#val to collected_item#value\n* 0.0.1 - Public release\n\n## License ##\n\nMIT License. Copyright 2014 Dennis Walters\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fess%2Fcollectable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fess%2Fcollectable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fess%2Fcollectable/lists"}