This project is archived and is in readonly mode.

#3745 ✓ resolved
Gabe da Silveira

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

Reported by Gabe da Silveira | January 19th, 2010 @ 04:47 AM | in 3.0.2

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?

Comments and changes to this ticket

  • Jeremy Kemper

    Jeremy Kemper January 19th, 2010 @ 06:27 PM

    • Milestone cleared.
    • State changed from “new” to “open”
    • Assigned user set to “Carl Lerche”
  • Gabe da Silveira

    Gabe da Silveira January 19th, 2010 @ 07:19 PM

    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.

  • Ryan Bigg

    Ryan Bigg January 20th, 2010 @ 12:33 AM

    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?

  • Prem Sichanugrist (sikachu)

    Prem Sichanugrist (sikachu) January 20th, 2010 @ 06:10 AM

    • 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.

  • Rizwan Reza

    Rizwan Reza February 12th, 2010 @ 12:46 PM

    • Tag changed from bugmash, plugins, rails3 to plugins, rails3
  • José Valim

    José Valim February 16th, 2010 @ 11:12 PM

    • State changed from “open” to “resolved”
    • Assigned user changed from “Carl Lerche” to “José Valim”

    Fixed.

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
    • Importance changed from “” to “High”

Create your profile

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

Tickets have moved to Github

The new ticket tracker is available at https://github.com/rails/rails/issues

Shared Ticket Bins

Pages