Represents the data type Text.

Methods
Public Class methods
operator_sign( op )

Additional operators for instances of Text. See Base#operator_sign

  # Selects all posts having "surveillance" in their content field
  # while ignoring case.
  Posts.select( :content => {:ilike => 'surveillance'} )
# File lib/momomoto/datatype/text.rb, line 31
      def self.operator_sign( op )
        case op
          when :like then 'LIKE'
          when :ilike then 'ILIKE'
          else
            super( op )
        end
      end
Public Instance methods
equal( a, b )

Compares two values and returns true if equal or false otherwise. It is used to check if a row field has been changed so that only changed fields are written to database.

# File lib/momomoto/datatype/text.rb, line 10
      def equal( a, b )
        a.to_s == b.to_s
      end
escape( input )

Escapes input to be saved in database. Returns ‘NULL’ if input is nil or empty. Otherwise escapes using Database#escape_string

# File lib/momomoto/datatype/text.rb, line 17
      def escape( input )
        if input.nil? || input.to_s.empty?
          "NULL"
        else
          "E'" + Database.escape_string( input.to_s ) + "'"
        end
      end