Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Deprecation warning (RAILS_ROOT) under Rails 3 #12

Open
wincent opened this Issue · 6 comments

3 participants

@wincent

Just started experimenting with Rails 3 and am seeing deprecation warnings on starting up the server or the console in the Rails development/test environments:

DEPRECATION WARNING: RAILS_ROOT is deprecated! Use Rails.root instead. (called from load_example_data at src/vendor/gems/fixture_replacement-3.0.1/lib/fixture_replacement/class_methods.rb:20)

Haven't actually got the app up and running yet under Rails 3, so can't confirm whether FixtureReplacement actually works or not yet.

If I can get it working I'll see if I can whip up a patch to silence the warning.

Cheers,
Wincent

@smtlaissezfaire

Thanks wincent. I haven't tried to use it with rails 3 yet. I'll update when rails 3 support is added.

@wincent

Pushed a couple of commits to the "rails3" branch in my fork:

http://github.com/wincent/fixturereplacement/commits/rails3

One makes the spec and test suites pass under Rails 3.

The other silences the deprecation warning.

I didn't update the tests yet, so currently only the RAILS_ROOT code path is being tested. Let me know if you think the other code path should be tested (although it seems a bit convoluted).

Cheers,
Wincent

@smtlaissezfaire

Hey Wincent,

I'll look to merge these changes into the main repository either tonight or tomorrow.

@caifara

According to https://rails.lighthouseapp.com/projects/8994/tickets/4016-railsroot-returns-nil-before-app-initialization-silently-breaking-some-gems fixture_replacement should use a Railtie to make sure Rails.root is set. I did not look into how to do that, but the problem just hit my setup making Rails 3 unable to find my example data.

@caifara

Great, thanks. I've used that approach in my rails3 branch

http://github.com/caifara/fixturereplacement/commit/5a9fecd742c0b366140c85c1066bf664ab22e652

It works now ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.