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.

Having rails/init.rb in plugin should generate deprecation warning since it's is not being called anymore

#3745

I was not able to find any information about this in any of the blog posts or even during the latest bugmash. However, in my attempt to get my app updated to Rails 3 I noticed that one plugin super_exception_notifier I use that follows the official recommended plugin procedure no longer seems to be calling rails/init.rb.

Digging through git I identified this commit which seems to completely remove gem-style init loading. The gem-style plugin fixture that used to be used seems to just be orphaned without test coverage now. It seems like everything was collapsed down to a simpler case which maybe was intended to work with gems, but there is no longer a test case explicitly covering it. Either that or the particular gem I'm looking at or my Bundler vendor setup is somehow broken.

In any case, I am happy to work on a patch for this, but I need to know is rails/init.rb deprecated? Should we be just putting conditionals in the standard required file like factory_girl does? Is there another way to somehow flag a gem as a plugin that I'm missing?

Reported by Gabe da Silveira · January 19th, 2010 @ 04:47 AM

State: resolved
Milestone: 3.0.2
Assigned to: José Valim José Valim
Importance: High

Activity

  1. Jeremy Kemper
    Jeremy Kemper
    • Milestone cleared.
    • State changed from new to open
    • Assigned user set to Carl Lerche

    January 19th, 2010 @ 06:27 PM

  2. Gabe da Silveira
    Gabe da Silveira

    Jeremy, thanks for dropping by. I caught Yehuda on irc and he tells me that the API is changed intentionally. I do believe this needs documentation though, definitely before Rails 3 drops. Deprecation would have been nice, but considering the scope of changes in Rails 3 it doesn't really seem worth it--there will be many breaking changes already.

    January 19th, 2010 @ 07:19 PM

  3. Ryan Bigg
    Ryan Bigg

    I also noticed this with my by_star plugin. To make it dually compatible between 2.3 and 3.0 I've copied the file to the root folder and it seems to work ok. Should I just have a lib/by_star.rb file and let Rails automatically include that? Is that how it works now?

    January 20th, 2010 @ 12:33 AM

  4. Prem Sichanugrist (sikachu)
    Prem Sichanugrist (sikachu)
    • Title changed from rails/init.rb is not being called anymore to Having rails/init.rb in plugin should generate deprecation warning since it's is not being called anymore

    @Gabe da Silveira

    +1 on the deprecation warning. I believe that Rails 3 is under rapid development, so they forgot to put one in.

    @Ryan

    After I have followed the irc, I think lib/by_star.rb should be a way to go for 3.0 compatibility.

    January 20th, 2010 @ 06:10 AM

  5. Rizwan Reza
    Rizwan Reza
    • Tag changed from bugmash, plugins, rails3 to plugins, rails3

    February 12th, 2010 @ 12:46 PM

  6. José Valim
    José Valim
    • State changed from open to resolved
    • Assigned user changed from Carl Lerche to José Valim

    Fixed.

    February 16th, 2010 @ 11:12 PM

  7. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to High

    October 15th, 2010 @ 11:01 PM