Module: EdgeRider::Development

Extended by:
Development
Included in:
Development
Defined in:
lib/edge_rider/development.rb

Instance Method Summary collapse

Instance Method Details

#selects_star_with_conditions_pattern(table, conditions) ⇒ Object



5
6
7
8
9
10
# File 'lib/edge_rider/development.rb', line 5

def selects_star_with_conditions_pattern(table, conditions)
  table = Regexp.quote(table)
  conditions = Regexp.quote(conditions) unless conditions.is_a?(Regexp)
  quote = '[`"]?'
  /\ASELECT (#{quote}#{table}#{quote}\.)?\* FROM #{quote}#{table}#{quote}\s+WHERE \(?#{conditions}\)?\s*\z/
end