What's the Rails 3 replacement for ActiveRecord::Errors?
In Rails 2.3.8, this is an object:
>> ActiveRecord::Errors
=> ActiveRecord::Errors
In Rails 3.0.0rc, you get a NameError:
>> ActiveRecord::Errors
NameError: uninitialized constant ActiveRecord::Errors
from (irb):2
I'm trying to make the wizardly generator work with Rails 3.
$ rails g wizardly_scaffold home
But it fails:
/Library/Ruby/Gems/1.8/gems/wizardly_gt-0.1.8.9/lib/validation_group.rb:150:
uninitialized constant ActiveRecord::Errors (NameError)
The line it refers to is this:
ActiveRecord::Errors.send :include, ValidationGroup::ActiveRecord::Errors
Earlier in the file, we see:
module ValidationGroup
module ActiveRecord
...
module Errors # included in ActiveRecord::Errors
def add_with_validation_group(attribute, msg = I18n.translate('activerecord.errors.messages')[:invalid], *args, &block)
add_error = @base.respond_to?(:should_validate?) ? (@base.should_validate?(attribute.to_sym) || attribute == :base) : true
add_without_validation_group(attribute, msg, *args, &block) if add_error
end
...
end