{"id":23082499,"url":"https://github.com/madwork/validates_duplicity_of","last_synced_at":"2026-05-19T05:40:40.099Z","repository":{"id":59159061,"uuid":"13651223","full_name":"madwork/validates_duplicity_of","owner":"madwork","description":"ActiveRecord callback which handle the name duplication in your model.","archived":false,"fork":false,"pushed_at":"2016-09-20T16:42:28.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-29T10:40:01.059Z","etag":null,"topics":["activerecord","callback","rails"],"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/madwork.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":"2013-10-17T14:25:07.000Z","updated_at":"2017-02-24T12:21:55.000Z","dependencies_parsed_at":"2022-09-13T20:10:17.954Z","dependency_job_id":null,"html_url":"https://github.com/madwork/validates_duplicity_of","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/madwork/validates_duplicity_of","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madwork%2Fvalidates_duplicity_of","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madwork%2Fvalidates_duplicity_of/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madwork%2Fvalidates_duplicity_of/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madwork%2Fvalidates_duplicity_of/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madwork","download_url":"https://codeload.github.com/madwork/validates_duplicity_of/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madwork%2Fvalidates_duplicity_of/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002342,"owners_count":26083356,"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-10-09T02:00:07.460Z","response_time":59,"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":["activerecord","callback","rails"],"created_at":"2024-12-16T14:53:52.983Z","updated_at":"2025-10-12T08:32:42.879Z","avatar_url":"https://github.com/madwork.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# validates_duplicity_of\n\n[![Build Status](https://travis-ci.org/madwork/validates_duplicity_of.svg)](https://travis-ci.org/madwork/validates_duplicity_of)\n[![Gem](https://badge.fury.io/rb/validates_duplicity_of.svg)](https://rubygems.org/gems/validates_duplicity_of)\n\nActiveRecord (\u003e= 3.2) callback which handle the name duplication in your model with ease.\nRuby 2 only!\n\n**Example:**\n\nUntitled File \u003e Untitled File (1) \u003e Untitled File (2) ...\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'validates_duplicity_of'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install validates_duplicity_of\n\n## Usage\n\nUse the method `validates_duplicity_of` with an attribute in your Rails model. The scope is optional.\n\n```ruby\nclass Post \u003c ActiveRecord::Base\n  validates_duplicity_of :name\nend\n\npost = Post.create name: \"Foo\"\npost.name\n=\u003e \"Foo\"\n\npost = Post.create name: \"Foo\"\npost.name\n=\u003e \"Foo (1)\"\n\nclass Note \u003c ActiveRecord::Base\n  validates_duplicity_of :title, scope: :user_id\nend\n\nnote = Note.create title: \"Bar\", user_id: 1\nnote.title\n=\u003e \"Bar\"\n\nnote = Note.create title: \"Bar\", user_id: 1\nnote.title\n=\u003e \"Bar (1)\"\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/madwork/validates_duplicity_of.\n\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadwork%2Fvalidates_duplicity_of","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadwork%2Fvalidates_duplicity_of","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadwork%2Fvalidates_duplicity_of/lists"}