-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
I'm getting this warning with Mongoid 4.0.0 and Rails 4.1.6:
DEPRECATION WARNING: The `Validator#setup` instance method is deprecated and will be removed on Rails 4.2. Do your setup in the constructor instead: class MyValidator < ActiveModel::Validator def initialize(options={}) super options[:class].send :attr_accessor, :custom_attribute end end . (called from <class:Place> at /api/app/models/place.rb:55)
Here's the line of code at /api/app/models/place.rb:55:
validates_uniqueness_of :factual_id
So, it appears to be an issue with the Mongoid::Validatable::UniquenessValidator.
It looks like the setup method was removed in Mongoid 4.0.0, so I don't understand why this is happening. Any ideas?