Method: ActiveRecord::ConnectionAdapters::Quoting::ClassMethods#column_name_matcher

Defined in:
activerecord/lib/active_record/connection_adapters/abstract/quoting.rb

#column_name_matcherObject

Regexp for column names (with or without a table name prefix). Matches the following:

"#{table_name}.#{column_name}"
"#{column_name}"


18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'activerecord/lib/active_record/connection_adapters/abstract/quoting.rb', line 18

def column_name_matcher
  /
    \A
    (
      (?:
        # table_name.column_name | function(one or no argument)
        ((?:\w+\.)?\w+ | \w+\((?:|\g<2>)\))
      )
      (?:(?:\s+AS)?\s+\w+)?
    )
    (?:\s*,\s*\g<1>)*
    \z
  /ix
end