def method_missing(method_name, *args)
      if method_name.to_s =~ /^(.*)=$/
        @attrs[$1.to_sym] = args[0]
      else
        val = @attrs[method_name.to_sym]
        case column_type(method_name)
        when :integer
          if val =~ /^\d+$/
            val.to_i
          else
            val
          end
        else
          val
        end
      end
    end
def method_missing(method_name, *args)
      if method_name.to_s =~ /^(.*)=$/
        @attrs[$1.to_sym] = args[0]
      else
        val = @attrs[method_name.to_sym]
        case column_type(method_name)
        when :integer
          if val =~ /^\d+$/
            val.to_i
          else
            val
          end
        else
          val
        end
      end
    end
Build SearchForm object from ActiveRecord 'klass' and attrs.

 === INPUTS
 klass:: ActiveRecord
 attrs:: hash of key=>value pair
 map attribute name to hash entry.
 This mechanism is required to be used in 'form_for' helper.

 When column type is integer and has digits value, return integer.
 This is required for selection helper.
 Even it is integer but has no value, keeps blank.

 When attribute name ends '=', assignment to hash works.

 === EXAMPLE
 s = Searchform.new(Product, :name=>'a')
 s.name
 s.conditions      # ["name=?", "a"]
 s.name = 'b'      # method_missing('name=', 'b') is called
 s.conditions      # ["name=?", "b"]