lib/card/query/clause.rb in card-1.17.4 vs lib/card/query/clause.rb in card-1.18.0

- old
+ new

@@ -1,18 +1,18 @@ module Card::Query::Clause -# attr_accessor :clause + # attr_accessor :clause - def safe_sql(txt) - txt = txt.to_s - txt.match( /[^\w\*\(\)\s\.\,]/ ) ? raise( "WQL contains disallowed characters: #{txt}" ) : txt + def safe_sql txt + txt = txt.to_s + txt =~ /[^\w\*\(\)\s\.\,]/ ? raise("WQL contains disallowed characters: #{txt}") : txt + end + + def quote v + ActiveRecord::Base.connection.quote(v) end - def quote(v) ActiveRecord::Base.connection.quote(v) end - - def match_prep(v) + def match_prep v cxn ||= ActiveRecord::Base.connection [cxn, v] end - - -end \ No newline at end of file +end