Sha256: 426d4ad256d1d70df6fc69d0f757237f6b97c4cd49e837c8a2bf91a3f56c7344
Contents?: true
Size: 493 Bytes
Versions: 19
Compression:
Stored size: 493 Bytes
Contents
class Card::Query::Spec attr_accessor :spec def safe_sql(txt) txt = txt.to_s txt.match( /[^\w\*\(\)\s\.\,]/ ) ? raise( "WQL contains disallowed characters: #{txt}" ) : txt end def quote(v) ActiveRecord::Base.connection.quote(v) end def match_prep(v,cardspec=self) cxn ||= ActiveRecord::Base.connection [cxn, v] end def cast_type(type) cxn ||= ActiveRecord::Base.connection (val = cxn.cast_types[type.to_sym]) ? val[:name] : safe_sql(type) end end
Version data entries
19 entries across 19 versions & 1 rubygems