• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

DavyJonesLocker / client_side_validations / 286
72%
main: 100%

Build:
Build:
LAST BUILD BRANCH: chore/ruby4
DEFAULT BRANCH: main
Ran 02 Apr 2013 09:46PM UTC
Jobs 1
Files 55
Run time –
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
286

Pull #520

travis-ci

arr-ee
Added ability to override class name for uniqueness validator

Added `:client_validations` option to the `validate_uniqueness_of`,
where one can specify the real class name for the remote validation.

For example, we have a wrapper class for the User model, UserForm, and
it uses remote uniqueness validation for the email field.

```
class UserForm
  include ActiveRecord::Validations
  attr_accessor :email
  validates_uniqueness_of :email
end
```

However, this won't work since middleware will try to perform validation
against UserForm, and it's not persisted.

Now one can state which class should be used for validation:

```
class UserForm
  include ActiveRecord::Validations
  attr_accessor :email
  validates_uniqueness_of :email, :client_validations => { :class =>
  User }
end
```
Pull Request #520: Added ability to override class name for uniqueness validator

15 of 15 new or added lines in 3 files covered. (100.0%)

1347 of 1384 relevant lines covered (97.33%)

8.68 hits per line

Jobs
ID Job ID Ran Files Coverage
1 286.1 (1.9.3) 02 Apr 2013 09:46PM UTC 0
97.33
Travis Job 286.1
Source Files on build 286
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #286
  • Pull Request #520
  • PR Base - 3-2-stable (#282)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc