I’m getting this error after running my specs, i have a file called “validations.rb” inside my /support directory and inside the spec_helper.rb there is this line
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
so it should include my validations.rb file, but i still get the error for undefined method, what am I doing wrong?
validations.rb
module ::ActiveModel::Validations
def errors_on(attribute)
self.valid?
[self.errors[attribute]].flatten.compact
end
alias :error_on :errors_on
end
Redefine
errors_onasself.errors_on