{"id":25436703,"url":"https://github.com/umar221b/errors_full_details","last_synced_at":"2025-06-21T13:38:19.669Z","repository":{"id":56844771,"uuid":"178170302","full_name":"umar221b/errors_full_details","owner":"umar221b","description":"Extend ActiveModel::Errors to display messages with error codes.","archived":false,"fork":false,"pushed_at":"2021-04-17T03:59:11.000Z","size":8,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-24T17:42:13.610Z","etag":null,"topics":["hacktoberfest","rails","ruby"],"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/umar221b.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":"2019-03-28T09:28:55.000Z","updated_at":"2022-10-27T07:02:09.000Z","dependencies_parsed_at":"2022-09-09T19:12:20.003Z","dependency_job_id":null,"html_url":"https://github.com/umar221b/errors_full_details","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/umar221b/errors_full_details","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umar221b%2Ferrors_full_details","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umar221b%2Ferrors_full_details/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umar221b%2Ferrors_full_details/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umar221b%2Ferrors_full_details/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/umar221b","download_url":"https://codeload.github.com/umar221b/errors_full_details/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/umar221b%2Ferrors_full_details/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261130717,"owners_count":23114025,"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":["hacktoberfest","rails","ruby"],"created_at":"2025-02-17T08:21:49.264Z","updated_at":"2025-06-21T13:38:14.652Z","avatar_url":"https://github.com/umar221b.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ErrorsFullDetails\nAdds a new method to ActiveModel::Errors to display messages with codes using details.\n\n## Usage\nAdd errors with codes to an object:\n\n```ruby\nclass Person \u003c ApplicationRecord\n  validate :username_is_cool\n  validate :title_is_looking_good\n  validate :default_code\n\n  private\n\n  def username_is_cool\n    errors.add(:username, 'is not cool', code: 15)\n  end\n\n  def title_is_looking_good\n    errors.add(:title, 'is not looking good', code: '210')\n  end\n\n  def default_code\n    errors.add(:base, 'This error has a default code')\n  end\nend\n```\n\nCall `object.errors.full_details` to generate an array of error messages and codes:\n\n```ruby\n[\n  {\n    message: \"Username is not cool\",\n    code: \"15\"\n  },\n  {\n    message: \"Title is not looking good\",\n    code: \"210\"\n  },\n  {\n    message: \"This error has a default code\",\n    code: \"0\"\n  }\n]\n```\n\nErrors added without an error code will return `'0'` as a default error code.\n\n## Installation\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'errors_full_details', '~\u003e 0.0.4'\n```\n\nAnd then execute:\n```bash\n$ bundle\n```\n\n## License\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%2Fumar221b%2Ferrors_full_details","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumar221b%2Ferrors_full_details","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumar221b%2Ferrors_full_details/lists"}