method

parse_raw_value_as_a_number

Importance_0
v3.0.9 - Show latest stable - 0 notes - Class: ActiveModel::Validations::NumericalityValidator
parse_raw_value_as_a_number(raw_value) protected

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activemodel/lib/active_model/validations/numericality.rb, line 63
      def parse_raw_value_as_a_number(raw_value)
        case raw_value
        when /\A0[xX]/
          nil
        else
          begin
            Kernel.Float(raw_value)
          rescue ArgumentError, TypeError
            nil
          end
        end
      end
Register or log in to add new notes.