Deprecation warning (RAILS_ROOT) under Rails 3 #12

Closed
wincent opened this Issue Apr 26, 2010 · 6 comments

Comments

Projects
None yet
3 participants
@wincent
Contributor

wincent commented Apr 26, 2010

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

This comment has been minimized.

Show comment Hide comment
@smtlaissezfaire

smtlaissezfaire Apr 26, 2010

Owner

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

Owner

smtlaissezfaire commented Apr 26, 2010

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

@wincent

This comment has been minimized.

Show comment Hide comment
@wincent

wincent Jun 10, 2010

Contributor

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

Contributor

wincent commented Jun 10, 2010

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

This comment has been minimized.

Show comment Hide comment
@smtlaissezfaire

smtlaissezfaire Jun 15, 2010

Owner

Hey Wincent,

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

Owner

smtlaissezfaire commented Jun 15, 2010

Hey Wincent,

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

@caifara

This comment has been minimized.

Show comment Hide comment
@caifara

caifara Jul 9, 2010

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 commented Jul 9, 2010

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.

@wincent

This comment has been minimized.

Show comment Hide comment
@caifara

This comment has been minimized.

Show comment Hide comment
@caifara

caifara Jul 10, 2010

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

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

It works now ...

caifara commented Jul 10, 2010

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

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

It works now ...

@wincent wincent closed this Jun 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment