Removed deprecation warnings surrounding 'named_scope' #1

Open
wants to merge 5 commits into
from

Conversation

Projects
None yet
4 participants
@hoverlover

I changed the calls to the Rails 3 deprecated method named_scope in favor of scope. I tried running the tests but I'm getting the following error:

rake test RAILS_FRAMEWORK_ROOT=/Users/cboyd/.rvm/gems/ruby-1.9.2-p0:/Users/cboyd/.rvm/gems/ruby-1.9.2-p136/gems/rails-3.0.3
(in /Users/cboyd/workspace/preferences)
/Users/cboyd/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I"lib:lib" "/Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/preferences_test.rb" "test/unit/preference_definition_test.rb" "test/unit/preference_test.rb" 
/Users/cboyd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:274:in `activate': can't activate rails (= 2.3.8, runtime) for [], already activated rails-3.0.3 for [] (Gem::LoadError)
    from /Users/cboyd/.rvm/rubies/ruby-1.9.2-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:216:in `try_activate'
    from <internal:lib/rubygems/custom_require>:32:in `rescue in require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/plugin_test_helper-0.3.1/generators/plugin_test_structure/templates/app_root/config/boot.rb:58:in `load_initializer'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/plugin_test_helper-0.3.1/generators/plugin_test_structure/templates/app_root/config/boot.rb:41:in `run'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/plugin_test_helper-0.3.1/generators/plugin_test_structure/templates/app_root/config/boot.rb:14:in `boot!'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/plugin_test_helper-0.3.1/generators/plugin_test_structure/templates/app_root/config/boot.rb:115:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/plugin_test_helper-0.3.1/lib/plugin_test_helper.rb:13:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:33:in `require'
    from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from /Users/cboyd/workspace/preferences/test/test_helper.rb:4:in `<top (required)>'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from <internal:lib/rubygems/custom_require>:29:in `require'
    from test/functional/preferences_test.rb:1:in `<top (required)>'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `block in <main>'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
    from /Users/cboyd/.rvm/gems/ruby-1.9.2-p0/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `<main>'
rake aborted!
Command failed with status (1): [/Users/cboyd/.rvm/rubies/ruby-1.9.2-p0/bin...]

Since this is just a simple method name change for a method that is already tested in the Rails source, I don't think there should be any failures from my changes. If you would like to help me get the tests running that would be great too!

@hoverlover

This comment has been minimized.

Show comment Hide comment
@hoverlover

hoverlover Feb 22, 2011

Also, I am now requiring app/models/preference.rb. I'm not sure how this ever worked before, as I didn't see anyplace that this file was being required. Maybe the intention was to copy this file over to the projects app/models directory, but the README didn't state that. Anyway, it is now being required and works.

Also, I am now requiring app/models/preference.rb. I'm not sure how this ever worked before, as I didn't see anyplace that this file was being required. Maybe the intention was to copy this file over to the projects app/models directory, but the README didn't state that. Anyway, it is now being required and works.

@hoverlover

This comment has been minimized.

Show comment Hide comment
@hoverlover

hoverlover Feb 22, 2011

Added an accessible_preference method that will cause attr_accessible to be called on the model for the preference.

Added an accessible_preference method that will cause attr_accessible to be called on the model for the preference.

@hoverlover

This comment has been minimized.

Show comment Hide comment
@hoverlover

hoverlover Mar 17, 2011

I really would like to move my project that is using this off of my fork. Any idea when/if you are going to pull this? I think it's a valuable addition.

I really would like to move my project that is using this off of my fork. Any idea when/if you are going to pull this? I think it's a valuable addition.

@tatyree

This comment has been minimized.

Show comment Hide comment
@tatyree

tatyree Sep 21, 2011

+1.

Would also like to see the back of the class_inheritable_attribute warning.

tatyree commented Sep 21, 2011

+1.

Would also like to see the back of the class_inheritable_attribute warning.

@hoverlover

This comment has been minimized.

Show comment Hide comment
@hoverlover

hoverlover Sep 21, 2011

Any update on this pull request? I know we had a discussion a while ago about how you didn't know when you would be able to work on your open source projects due to you being so busy. I wouldn't mind helping you out if you want to make me a contributor.

Any update on this pull request? I know we had a discussion a while ago about how you didn't know when you would be able to work on your open source projects due to you being so busy. I wouldn't mind helping you out if you want to make me a contributor.

@hoverlover

This comment has been minimized.

Show comment Hide comment
@hoverlover

hoverlover Sep 21, 2011

I reviewed the 3 outstanding pull requests. There is commonality among them all, so they should be simple to pull in. Like I said, I don't mind doing this for you if you want to add me as a collaborator on the project.

I reviewed the 3 outstanding pull requests. There is commonality among them all, so they should be simple to pull in. Like I said, I don't mind doing this for you if you want to add me as a collaborator on the project.

@sdhull

This comment has been minimized.

Show comment Hide comment
@sdhull

sdhull Nov 2, 2011

+1

yo @pluginaweek, give some love to @hoverlover and make him a committer if you don't have to time to accept pull requests anymore.

sdhull commented Nov 2, 2011

+1

yo @pluginaweek, give some love to @hoverlover and make him a committer if you don't have to time to accept pull requests anymore.

@ojak

This comment has been minimized.

Show comment Hide comment
@ojak

ojak Jan 1, 2012

+1

ojak commented Jan 1, 2012

+1

ericgoodwin referenced this pull request in flowapp/preferences Jan 14, 2015

malacalypse added a commit to bookwitty/preferences that referenced this pull request Jul 13, 2017

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