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.

incorrect deprecation notice in ActiveModel::Errors

#5230

Method add() in ActiveModel::Errors calls its method generate_message() in a way which is marked as deprecated:

DEPRECATION WARNING: ActiveModel::Errors#generate_message(attributes, custom_message) has been deprecated.
Use ActiveModel::Errors#generate_message(attributes, :message => 'your message') instead. (called from generate_message at .../activemodel-3.0.0.rc/lib/active_model/errors.rb:289)

Reported by Jakub Suder · July 28th, 2010 @ 04:44 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: Low

Activity

  1. Jakub Suder
    Jakub Suder
    • Title changed from ActiveModel::Errors causes a deprecation notice on itself to incorrect deprecation notice in ActiveModel::Errors

    Oops, my bad, that was actually an issue with Mongoid, not ActiveModel.

    The deprecation message is confusing though, it looks like it was copy-pasted from another method. Instead of:

    "ActiveModel::Errors#generate_message(attributes, custom_message) has been deprecated. Use ActiveModel::Errors#generate_message(attributes, :message => 'your message') instead."

    it should be something like:

    "ActiveModel::Errors#generate_message(attributes, :default => 'your message') has been deprecated. Use ActiveModel::Errors#generate_message(attributes, :message => 'your message') instead."

    (The warning is caused by using the key :default in the options, not by passing a string as second argument, which probably wouldn't work at all.)

    August 9th, 2010 @ 11:26 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to invalid
    • Importance changed from to Low

    August 11th, 2010 @ 02:01 PM

  3. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 14th, 2010 @ 05:29 AM