Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

AR "references" deprecation warning when searching for email addresses #9712

Closed
pwnall opened this Issue · 5 comments

3 participants

@pwnall

This is a Rails 4.0.0.beta1 regression.

The deprecation warning in ActiveRecord::Relation::references_eager_loaded_tables? fires whenever a query contains an includes and an e-mail value. In fact, the regular expression used to scan for table names is really brittle. (which is why this warning came to be in the first place)

The rate of false positives makes the warning really annoying, as it litters my unit test output. Please consider either

  1. a configuration option that removes the warning and the deprecated behavior, or
  2. a configuration option that silences the warning, or
  3. a Relation method like "references" that says "I know what I'm doing, silence this warning"

The regexp problem was documented in #7177

Thank you!

@senny
Owner

I agree that having a deprecation warning that fires without being able to solve the problem is annoying. I would implement option 1 as it replicated the behaviour after the deprecation. The only downside is that we than have to deprecate the option with 4.1.

@jonleighton thoughts?

@jonleighton
Collaborator

@senny option 1 sounds sensible.

@jonleighton
Collaborator

@senny do you want to work on this? if not I'll do it.

@senny
Owner

@jonleighton I'm on it.

@senny senny referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@senny senny referenced this issue from a commit
Commit has since been removed from the repository and is no longer available.
@senny senny closed this in 34402c7
@pwnall

Thank you very much!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.