Method: ActiveRecord::Extensions::ArrayExt.process

Defined in:
lib/ar-extensions/extensions.rb

.process(key, val, caller) ⇒ Object



179
180
181
182
183
184
185
186
187
188
# File 'lib/ar-extensions/extensions.rb', line 179

def self.process( key, val, caller )
  if val.is_a?( Array )
    match_data = key.to_s.match( NOT_EQUAL_RGX )
    key = match_data.captures[0] if match_data
    str = "#{caller.quoted_table_name}.#{caller.connection.quote_column_name( key )} " +
      (match_data ? 'NOT ' : '') + "IN( ? )"
    return Result.new( str, val )
  end
  nil
end