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

Deprecation warning when setting a scope for uniqueness #10888

Closed
markhorrocks opened this issue Jun 8, 2013 · 2 comments
Closed

Deprecation warning when setting a scope for uniqueness #10888

markhorrocks opened this issue Jun 8, 2013 · 2 comments

Comments

@markhorrocks
Copy link

validates :email, presence: true, uniqueness: {scope: :club_id}

produces a warning in console

SELECT "users".* FROM "users" WHERE "users"."email" = 'me@me.com' LIMIT 1
DEPRECATION WARNING: Calling #scope or #default_scope with a hash is deprecated. Please use a lambda containing a scope. E.g. scope :red, -> { where(color: 'red') }.

@senny
Copy link
Member

senny commented Jun 12, 2013

I looked through the rails test-suite and there are similar definitions that don't raise the deprecation warning. Can you reproduce the issue using an executable test-case? You can use this script as a foundation https://github.com/rails/rails/blob/master/guides/bug_report_templates/active_record_gem.rb

If you post such a test-case that exposes the warning I'll take another look.

@senny
Copy link
Member

senny commented Jul 12, 2013

@markhorrocks it's been a month since we heard from you. I'm closing this issue but if you still experience the problem please provide additional debugging information in the form of a test-case or a sample application.

Thanks for reporting.

@senny senny closed this as completed Jul 12, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants