I recently upgraded to Rails 3, and this error has come up ubiquitously: DEPRECATION WARNING: Base.named_scope has been deprecated, please use Base.scope instead. Any ideas on how to get rid of it? Or should I just wait for something? There''s actually no place in my application where the code "Base.named_scope" exists, so I assume the problem is inherent in gems that haven''t gotten up to speed with Rails 3 yet. Someone on stackoverflow also posted this issue: http://stackoverflow.com/questions/3333612/how-to-avoid-deprecation-warning-with-named-scope-rails-2-x-scope-rails-3-c I''d appreciate any help. Thanks in advance =]. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Sep-01 16:11 UTC
Re: deprecation warning in Rails 3 about Base.named_scope
daze wrote:> I recently upgraded to Rails 3, and this error has come up > ubiquitously: > > DEPRECATION WARNING: Base.named_scope has been deprecated, please use > Base.scope instead. > > Any ideas on how to get rid of it? Or should I just wait for > something? > There''s actually no place in my application where the code > "Base.named_scope" exists,That literal string doesn''t have to be present; it''s just the qualified name of the method being called. Are you calling named_scope anywhere?> so I assume the problem is inherent in gems > that haven''t gotten up to speed with Rails 3 yet. > > Someone on stackoverflow also posted this issue: > http://stackoverflow.com/questions/3333612/how-to-avoid-deprecation-warning-with-named-scope-rails-2-x-scope-rails-3-c > > I''d appreciate any help. Thanks in advance =].Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Wed, Sep 1, 2010 at 10:22 AM, daze <dmonopoly10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I recently upgraded to Rails 3, and this error has come up > ubiquitously: > > DEPRECATION WARNING: Base.named_scope has been deprecated, please use > Base.scope instead. > > Any ideas on how to get rid of it? Or should I just wait for > something? >ActiveRecord''s named_scope was changed to scope in Rails 3, and uses the new ActiveRecord query interface. See also: http://edgerails.info/articles/what-s-new-in-edge-rails/2010/02/23/the-skinny-on-scopes-formerly-named-scope/> There''s actually no place in my application where the code > "Base.named_scope" exists, so I assume the problem is inherent in gems > that haven''t gotten up to speed with Rails 3 yet. >If you aren''t using any named_scopes, then it sounds like you might want to isolate the problem to a specific gem or plugin and log a bug with the author. Try creating a new Rails 3 project and adding your gems one by one.> > Someone on stackoverflow also posted this issue: > > http://stackoverflow.com/questions/3333612/how-to-avoid-deprecation-warning-with-named-scope-rails-2-x-scope-rails-3-c > > I''d appreciate any help. Thanks in advance =]. >Adam -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
okay, thanks...I think I might try that. (I did not have any occurrences of named_scope anywhere in my code, just for clarification) I noticed though that the problem seems to stem from the acts_as_authentic line in my User model. might that mean anything? what exactly is that line anyway.... -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2010-Sep-01 21:40 UTC
Re: Re: deprecation warning in Rails 3 about Base.named_scope
On Wed, Sep 1, 2010 at 1:37 PM, daze <dmonopoly10-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I noticed though that the problem seems to stem from the > acts_as_authentic line in my User model. might that mean anything? > what exactly is that line anyway....Presumably you put it there? :-) Anyway, from a project of my own: $ find -type f -name ''*.rb'' -exec grep -H ''acts_as_authentic'' {} \; app/models/user.rb: acts_as_authentic do |c| vendor/gems/authlogic-2.1.6/lib/authlogic/acts_as_authentic/base.rb: # Provides the base functionality for acts_as_authentic $ find vendor/gems/authlogic-2.1.6 -type f -name ''*.rb'' -exec grep ''named_scope'' {} \; named_scope :logged_in, lambda { {:conditions => ["last_request_at > ?", logged_in_timeout.seconds.ago]} } named_scope :logged_out, lambda { {:conditions => ["last_request_at is NULL or last_request_at <= ?", logged_in_timeout.seconds.ago]} } ... $ FWIW, -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Seemingly Similar Threads
- Authlogic: Trying to login in my Cucumber test - Authlogic::Session::Activation::NotActivatedError
- AuthLogic Question - one time password (persistence_token) - what config is required to use this???
- Problem with named_scope
- offeride :limit named_scope default_scope
- Testing that named_scope is defined