Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed deprecation warnings surrounding 'named_scope' #1

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Removed deprecation warnings surrounding 'named_scope' #1

wants to merge 5 commits into from

Conversation

hoverlover
Copy link

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
Copy link
Author

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
Copy link
Author

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

@hoverlover
Copy link
Author

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
Copy link

tatyree commented Sep 21, 2011

+1.

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

@hoverlover
Copy link
Author

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
Copy link
Author

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
Copy link

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
Copy link

ojak commented Jan 1, 2012

+1

ericgoodwin referenced this pull request in flowapp/preferences Jan 14, 2015
malacalypse pushed 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants