Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Changeset [d6cbb27e7b260c970bf7d07dc0b0591ed82cee2a] by José Valim

Revision d6cbb27e7b260c970bf7d07dc0b0591ed82cee2a, committed by José Valim · May 15th, 2010 @ 08:55 PM

Revert "Make ActiveModel::Errors#add_on_blank and #add_on_empty accept an options hash and make various Validators pass their (filtered) options."

Having a huge array to whitelist options is not the proper way to handle this case. This means that the ActiveModel::Errors object should know about the options given in all validators and break the extensibility added by the validators itself. If the intent is to whitelist options before sending them to I18n, each validator should clean its respective options instead of throwing the responsibility to the Errors object.

This reverts commit bc1c8d58ec45593acba614d1d0fecb49adef08ff.
http://github.com/rails/rails/commit/d6cbb27e7b260c970bf7d07dc0b059...

15 changed files

  • M activemodel/lib/active_model/errors.rb
  • M activemodel/lib/active_model/validations/acceptance.rb
  • M activemodel/lib/active_model/validations/confirmation.rb
  • M activemodel/lib/active_model/validations/exclusion.rb
  • M activemodel/lib/active_model/validations/format.rb
  • M activemodel/lib/active_model/validations/inclusion.rb
  • M activemodel/lib/active_model/validations/length.rb
  • M activemodel/lib/active_model/validations/numericality.rb
  • M activemodel/lib/active_model/validations/presence.rb
  • M activemodel/test/cases/validations/i18n_generate_message_validation_test.rb
  • M activemodel/test/cases/validations/i18n_validation_test.rb
  • M activerecord/lib/active_record/validations/associated.rb
  • M activerecord/lib/active_record/validations/uniqueness.rb
  • M activerecord/test/cases/validations/i18n_generate_message_validation_test.rb
  • M activerecord/test/cases/validations/i18n_validation_test.rb