{"id":19402053,"url":"https://github.com/sparkymat/symbolic_enum","last_synced_at":"2026-04-27T08:31:24.061Z","repository":{"id":26872810,"uuid":"111414865","full_name":"sparkymat/symbolic_enum","owner":"sparkymat","description":"An alternative implementation of Rails Enum","archived":false,"fork":false,"pushed_at":"2023-01-19T11:15:47.000Z","size":9671,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-12-05T09:44:54.749Z","etag":null,"topics":["array","enum","enumeration","ruby","ruby-on-rails"],"latest_commit_sha":null,"homepage":"","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/sparkymat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-20T13:37:02.000Z","updated_at":"2020-03-09T11:24:41.000Z","dependencies_parsed_at":"2023-02-10T23:01:00.816Z","dependency_job_id":null,"html_url":"https://github.com/sparkymat/symbolic_enum","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/sparkymat/symbolic_enum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkymat%2Fsymbolic_enum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkymat%2Fsymbolic_enum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkymat%2Fsymbolic_enum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkymat%2Fsymbolic_enum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sparkymat","download_url":"https://codeload.github.com/sparkymat/symbolic_enum/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sparkymat%2Fsymbolic_enum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32329462,"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":["array","enum","enumeration","ruby","ruby-on-rails"],"created_at":"2024-11-10T11:21:20.428Z","updated_at":"2026-04-27T08:31:24.026Z","avatar_url":"https://github.com/sparkymat.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# symbolic_enum\n\n`symbolic_enum` is an alternate implementation of [Rails enums](http://api.rubyonrails.org/classes/ActiveRecord/Enum.html), which changes the following:\n\n* The getters return symbols instead of strings.\n* Option to mark the field as an array. This assumes that the underlying database column is an integer array.\n* Option to disable scopes and/or setters.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'symbolic_enum'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install symbolic_enum\n\n## Usage\n\n`symbolic_enum` is used similar to `enum`. For example,\n\n```ruby\nclass Car \u003c ApplicationRecord\n  include SymbolicEnum\n\n  symbolic_enum category: {\n    sedan:     0,\n    hatchback: 1,\n    suv:       2,\n    other:     3,\n  }\nend\n\n# Usage\nc = Car.create!\nc.sedan!\n\nc.sedan? # true\n\nc.hatchback? # false\n\nc.category = :suv\n\nc.category # :suv\nc.save!\n\nCar.suv.pluck(:id).include?(c.id) # true\n\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/symbolic_enum.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkymat%2Fsymbolic_enum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsparkymat%2Fsymbolic_enum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsparkymat%2Fsymbolic_enum/lists"}