{"id":19856992,"url":"https://github.com/johnvuko/acts_as_uid","last_synced_at":"2025-07-22T21:06:39.315Z","repository":{"id":2104034,"uuid":"3045361","full_name":"johnvuko/acts_as_uid","owner":"johnvuko","description":"A plugin for generate unique UID for ActiveRecord model.  ","archived":false,"fork":false,"pushed_at":"2012-12-09T04:04:46.000Z","size":112,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-28T23:46:49.630Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"benmanns/goworker","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnvuko.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":"2011-12-24T16:52:53.000Z","updated_at":"2014-05-06T06:57:10.000Z","dependencies_parsed_at":"2022-09-08T01:50:15.077Z","dependency_job_id":null,"html_url":"https://github.com/johnvuko/acts_as_uid","commit_stats":null,"previous_names":["johnvuko/acts_as_uid"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/johnvuko/acts_as_uid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Facts_as_uid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Facts_as_uid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Facts_as_uid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Facts_as_uid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnvuko","download_url":"https://codeload.github.com/johnvuko/acts_as_uid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnvuko%2Facts_as_uid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266572688,"owners_count":23950074,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":[],"created_at":"2024-11-12T14:17:09.288Z","updated_at":"2025-07-22T21:06:39.292Z","avatar_url":"https://github.com/johnvuko.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"ActsAsUID\n======================\n\nA plugin for generate UID for ActiveRecord model. Usefull for generate token or hide number of elements in your database.\n\nInstallation\n------------\n\nInclude the gem in your Gemfile:\n\n    gem 'acts_as_uid', :git =\u003e 'https://github.com/jonathantribouharet/acts_as_uid'\n\n\nUsage\n-----\n\nIn your migrations:\n\t\n\tclass CreateUsers \u003c ActiveRecord::Migration\n\t\tdef self.up\n\t\t\tcreate_table :users do |t|\n\t\t\t\tt.uid\n\t\t\tend\n\t\t\tadd_index :users, :uid, :uniq =\u003e true\n\t\tend\n\tend\n\t\n\nMinimal configuration in your model:\n\t\n\tclass User \u003c ActiveRecord::Base\n\t\tacts_as_uid\n\tend\n\nCustom configuration in your model:\n\t\n\tclass User \u003c ActiveRecord::Base\n\t\tacts_as_uid do |config|\n\t\t\tconfig.acts_as_uid_size = 20\n\t\t\tconfig.acts_as_uid_charset = %w{ 0 1 2 3 4 5 6 7 8 9 A B C D E F}\n\t\tend\n\tend\n\n* `acts_as_uid_size` is the size of UID field, by default it's `15`.\n* `acts_as_uid_charset` is the charset of UID field, by default it's `%w{ 0 1 2 3 4 5 6 7 8 9 }`.\n\nUse dynamic method `User.find_by_uid!(\"012345\")` for find a record and raise `ActiveRecord::RecordNotFound` if the record is not found or `User.find_by_uid(\"012345\")` for return nil if the record is not found.\n\nIf you want replace the default find method in a model:\n\n\tclass User \u003c ActiveRecord::Base\n\t\tacts_as_uid\n\t\t\n\t\tdef self.find(*args)\n\t\t\tself.find_by_uid!(*args)\n\t\tend\n\tend\t\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvuko%2Facts_as_uid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnvuko%2Facts_as_uid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnvuko%2Facts_as_uid/lists"}