Module: Card::Query::Clause

Included in:
Card::Query, Value
Defined in:
lib/card/query/clause.rb

Instance Method Summary collapse

Instance Method Details

#match_prep(v) ⇒ Object



12
13
14
15
# File 'lib/card/query/clause.rb', line 12

def match_prep(v)
  cxn ||= ActiveRecord::Base.connection
  [cxn, v]
end

#quote(v) ⇒ Object



10
# File 'lib/card/query/clause.rb', line 10

def quote(v)  ActiveRecord::Base.connection.quote(v)  end

#safe_sql(txt) ⇒ Object

attr_accessor :clause



5
6
7
8
# File 'lib/card/query/clause.rb', line 5

def safe_sql(txt)
  txt = txt.to_s
  txt.match( /[^\w\*\(\)\s\.\,]/ ) ? raise( "WQL contains disallowed characters: #{txt}" ) : txt
end