Skip to content

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
Ruby on Rails member

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
Ruby on Rails member

@senny option 1 sounds sensible.

@jonleighton
Ruby on Rails member

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

@senny
Ruby on Rails member

@jonleighton I'm on it.

@senny senny closed this in 34402c7
@pwnall

Thank you very much!!

@myabc myabc referenced this issue in myabc/openproject
@myabc myabc Add explicit join references in models
Signed-off-by: Alex Coles <alex@alexbcoles.com>
787a35c
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.