{"id":16737629,"url":"https://github.com/shioyama/friendly_id-mobility","last_synced_at":"2026-03-06T09:03:30.795Z","repository":{"id":19645326,"uuid":"87555537","full_name":"shioyama/friendly_id-mobility","owner":"shioyama","description":"Translate FriendlyId slugs with Mobility","archived":false,"fork":false,"pushed_at":"2026-01-18T12:55:24.000Z","size":89,"stargazers_count":31,"open_issues_count":3,"forks_count":8,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-18T19:25:13.019Z","etag":null,"topics":["friendlyid","ruby","translate-slugs"],"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/shioyama.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-07T14:35:33.000Z","updated_at":"2026-01-18T12:55:23.000Z","dependencies_parsed_at":"2026-01-05T19:04:41.320Z","dependency_job_id":null,"html_url":"https://github.com/shioyama/friendly_id-mobility","commit_stats":{"total_commits":83,"total_committers":5,"mean_commits":16.6,"dds":0.07228915662650603,"last_synced_commit":"41f238d437a2817190564a10bdc3a2c92cdd327d"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/shioyama/friendly_id-mobility","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shioyama%2Ffriendly_id-mobility","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shioyama%2Ffriendly_id-mobility/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shioyama%2Ffriendly_id-mobility/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shioyama%2Ffriendly_id-mobility/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shioyama","download_url":"https://codeload.github.com/shioyama/friendly_id-mobility/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shioyama%2Ffriendly_id-mobility/sbom","scorecard":{"id":819358,"data":{"date":"2025-08-11","repo":{"name":"github.com/shioyama/friendly_id-mobility","commit":"45392451cdafc5adb90bce5fad9385f03f505edb"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":1,"reason":"Found 4/21 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/shioyama/friendly_id-mobility/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:41: update your workflow using https://app.stepsecurity.io/secureworkflow/shioyama/friendly_id-mobility/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:46: update your workflow using https://app.stepsecurity.io/secureworkflow/shioyama/friendly_id-mobility/ci.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Info: FSF or OSI recognized license: MIT License: LICENSE.txt:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T15:00:03.230Z","repository_id":19645326,"created_at":"2025-08-23T15:00:03.230Z","updated_at":"2025-08-23T15:00:03.230Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29689644,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T15:51:39.154Z","status":"ssl_error","status_checked_at":"2026-02-21T15:49:03.425Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["friendlyid","ruby","translate-slugs"],"created_at":"2024-10-13T00:27:13.351Z","updated_at":"2026-03-06T09:03:30.787Z","avatar_url":"https://github.com/shioyama.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"FriendlyId Mobility\n===================\n\n[![Gem Version](https://badge.fury.io/rb/friendly_id-mobility.svg)][gem]\n[![Build Status](https://github.com/shioyama/friendly_id-mobility/workflows/CI/badge.svg)][actions]\n[![Code Climate](https://api.codeclimate.com/v1/badges/1dad5895b69b4ae5bd38/maintainability.svg)][codeclimate]\n\n[gem]: https://rubygems.org/gems/friendly_id-mobility\n[actions]: https://github.com/shioyama/friendly_id-mobility/actions\n[codeclimate]: https://codeclimate.com/github/shioyama/friendly_id-mobility\n\n[Mobility](https://github.com/shioyama/mobility) support for\n[FriendlyId](https://github.com/norman/friendly_id).\n\nInstallation\n------------\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'friendly_id-mobility', '~\u003e 1.0.5'\n```\n\nAnd then execute:\n\n```\nbundle\n```\n\nThen run the Mobility generator:\n\n```\nrails generate mobility:install\n```\n\nThis will generate an initializer for Mobility. To ensure that FriendlyId sees\nchanges correctly on attributes, enable (uncomment) the `dirty` plugin line in\nyour Mobility configuration:\n\n```ruby\nMobility.configure do\n  plugins do\n    # ...\n    dirty\n    # ...\n  end\nend\n```\n\nNext, run the FriendlyId generator:\n\n```\nrails generate friendly_id\n```\n\nAnd migrate to generate Mobility and FriendlyId tables:\n\n```\nrake db:migrate\n```\n\nYou're ready to go!\n\nUsage\n-----\n\nThere are two ways to translate FriendlyId slugs with Mobility: with an\nuntranslated base column (like the SimpleI18n module included with FriendlyId),\nand with a translated base column.\n\n### Translating Slug\n\nIf you only want to translate the slug, include `Mobility` and translate the\nslug with whichever backend you want (here we're assuming the default KeyValue\nbackend). Here, `name` is untranslated (so there is a column on the\n`journalists` table named `name`):\n\n```ruby\nclass Journalist \u003c ActiveRecord::Base\n  extend Mobility\n  translates :slug\n\n  extend FriendlyId\n  friendly_id :name, use: :mobility\nend\n```\n\nYou can now save `name` and generate a slug, and update the slug in any locale\nusing `set_friendly_id`\n\n```ruby\njournalist = Journalist.create(name: \"John Smith\")\njournalist.slug\n#=\u003e \"john-smith\"\njournalist.set_friendly_id(\"Juan Fulano\", :es)\njournalist.save!\nI18n.with_locale(:es) { journalist.friendly_id }\n#=\u003e \"juan-fulano\"\n```\n\nSo the slug is translated, but the base attribute (`name`) is not.\n\n### Translating Slug and Base Attribute\n\nYou can also translate both slug and base attribute:\n\n```ruby\nclass Article \u003c ActiveRecord::Base\n  extend Mobility\n  translates :slug, :title\n\n  extend FriendlyId\n  friendly_id :title, use: :mobility\nend\n```\n\nIn this case, `title` is translated, and its value in the current locale will\nbe used to generate the slug in this locale:\n\n```ruby\narticle = Article.create(title: \"My Foo Title\")\narticle.title\n#=\u003e \"My Foo Title\"\narticle.slug\n#=\u003e \"my-foo-title\"\nMobility.locale = :fr\narticle.title = \"Mon titre foo\"\narticle.save\narticle.slug\n#=\u003e \"mon-titre-foo\"\nMobility.locale = :en\narticle.slug\n#=\u003e \"my-foo-title\"\n```\n\n### Friendly Finders with Translated Attributes\n\nThe Mobility `i18n` scope is mixed into the `friendly` scope for models which\n`use: :mobility`, so you can find translated slugs just like you would an\nuntranslated one:\n\n```ruby\nMobility.locale = :en\nArticle.friendly.find(\"my-foo-title\")\n#=\u003e #\u003cArticle id: 1 ...\u003e\nMobility.locale = :fr\nArticle.friendly.find(\"mon-titre-foo\")\n#=\u003e #\u003cArticle id: 1 ...\u003e\n```\n\nNote that this gem is not compatible with the `finders` add-on; using both\ntogether will lead to unexpected results. To use these finder methods, you will\nhave to remove `finders` and explicitly call `friendly.find`, as above.\n\n### Slug History\n\nTo use the FriendlyId history module, use `use: [:history, :mobility]` when\ncalling `friendly_id` from your model:\n\n```ruby\nclass Article \u003c ActiveRecord::Base\n  extend Mobility\n  translates :slug, :title\n\n  extend FriendlyId\n  friendly_id :title, use: [:history, :mobility]\nend\n```\n\nIt is important to have `:history` *before* `:mobility` here, since the\nMobility module looks for the presence of the history module and only adds\nnecessary overrides if history has been enabled (so the reverse order will not\nwork).\n\nTo use the history feature, you must add a `locale` column to your\n`friendly_id_slugs` table, which you can do with the `friendly_id_mobility` generator:\n\n```\nrails generate friendly_id_mobility\n```\n\nThen run the generated migration with `rake db:migrate`.\n\nLicense\n-------\n\nThe gem is available as open source under the terms of the [MIT\nLicense](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshioyama%2Ffriendly_id-mobility","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshioyama%2Ffriendly_id-mobility","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshioyama%2Ffriendly_id-mobility/lists"}