This project is archived and is in readonly mode.

#874 ✓invalid
matthuhiggins

ActiveRecord::Observer.observe should take a String

Reported by matthuhiggins | August 20th, 2008 @ 10:03 PM | in 2.x

This method only supports a class or symbol. It is inconsistent with most other API's in that it does not take a String.

This also improves namespacing support. For example:


MyObserver.observe 'products/widget'

There is an observer test for active model, but none exists for active record's observer. Does this need a test?

Comments and changes to this ticket

  • Pratik

    Pratik August 22nd, 2008 @ 02:38 AM

    • State changed from “new” to “invalid”
    • Assigned user set to “Pratik”

    Yup. A test would be needed. Also, following should work :

    
    MyObserver.observe :"products/widget"
    

    Will push the change once tests are added.

    Thanks.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Attachments

Pages