{"id":19001444,"url":"https://github.com/bumi/validation_rage","last_synced_at":"2025-04-22T17:47:07.033Z","repository":{"id":3761988,"uuid":"4838219","full_name":"bumi/validation_rage","owner":"bumi","description":null,"archived":false,"fork":false,"pushed_at":"2017-12-05T10:05:53.000Z","size":22,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T22:03:12.704Z","etag":null,"topics":[],"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/bumi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-06-29T23:26:36.000Z","updated_at":"2017-12-05T10:05:54.000Z","dependencies_parsed_at":"2022-09-13T10:11:09.908Z","dependency_job_id":null,"html_url":"https://github.com/bumi/validation_rage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fvalidation_rage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fvalidation_rage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fvalidation_rage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bumi%2Fvalidation_rage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bumi","download_url":"https://codeload.github.com/bumi/validation_rage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249283001,"owners_count":21243656,"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":[],"created_at":"2024-11-08T18:11:11.981Z","updated_at":"2025-04-16T22:31:16.442Z","avatar_url":"https://github.com/bumi.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ValidationRage\n\nValidationRage is a gem to capture validation errors from your Ruby application.\nThe goal is to identify usability issues in your application that are caused by validations.\n\nImaging a form with several field validations. ValidationRage makes it super easy to get information on what fields the users experience validation errors (and might leave because of that).\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'validation_rage'\n\n\n## Usage\n\nBy default ValidationRage will hook into ActiveRecord::Base and log all validation errors to your Rails log.\n\nValidationRage comes with an rails engine to configure your application. \"config\" in the following examples refer to Rails.application.config\nYou can configure if you want to hook into your models or controllers.\n\n### Logging on model level ###\n\nYou can hook ValidationRage into your classes that are ActiveModel::Validation compatible.\n\nexample configuration: \n\n    config.validation_rage.attach_to = [User, Account, Session] # hook into the User, Account, Session classes and attach an after_validation callback to track invalid records\n  \n### Logging on controller level ###\n\nThe problem with attaching ValidationRage to your models is that you do not have any information about the context: where did the error happen? what parameters causes the error? \nThat's why you can hook ValidationRage into your controllers. ValidationRage will add an after_callback checking your instance variables for errors.\n\nexample configuration:\n\n    config.validation_rage.attach_to = [\"users#create\", \"session#create\"] # hook into the Users and Session controler create actions\n    \n    # using * to match any action or any controller:\n    \n    config.validation_rage.attach_to = [\"*#create\"] # hook into every create action. - this is done by adding the after_filter to the ApplicationController\n    config.validation_rage.attach_to = [\"users#*\"] # hook into every action in the users controler.\n    \nexample configuration with both model and controller level logging:\n\n    config.validation_rage.attach_to = [\"users#create\", Company] # hook into the create action of the UsersController AND the Company model\n\n\n### Using different notifiers ###\n\nValidationRage uses ActiveSupport::Notifications to publish a notification message when an validation error happened. This makes it super easy to write a listener to those events and process the validation error information.\nThis gem comes with different Notifiers and since the integrate with ActiveSupport::Notifiers you can use several notifiers at the same time and write your own notifer.\n\n#### LogNotifier ####\n\nuses the logger to log your validation errors. \n\nconfiguration:\n\n    config.validation_rage.notifier[\"Log\"] = {:log_level =\u003e :warn, :logger =\u003e Logger.new(\"log/validations.log\")}\n\n#### UdpNotifier ####\n\nsend the errors as JSON to a UDP server server\n\nconfiguration:\n\n    config.validation_rage.notifier[\"Udp\"] = {:host =\u003e \"localhost\", :port =\u003e 3333}\n\n\n#### ValidationRageNotifer ####\n\nsend the errors to the ValidationRage Application which gives you a nice accessible interface to analyze your data.\nSignup at validationrage.com to get your API key\n\nconfiguration:\n\n    config.validation_rage.notifier[\"ValidationRage\"] = {:api_key =\u003e \"\u003cYOUR API KEY\u003e\"}\n    \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbumi%2Fvalidation_rage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbumi%2Fvalidation_rage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbumi%2Fvalidation_rage/lists"}