class Marten::DB::Field::Float
- Marten::DB::Field::Float
- Marten::DB::Field::Base
- Reference
- Object
Defined in:
marten/db/field.crmarten/db/field/float.cr
Constructors
Instance Method Summary
- 
        #default : Float64?
        
          Returns the default value of the field if any. 
- 
        #from_db(value) : Float64 | Nil
        
          Converts the raw DB value to the corresponding field value. 
- 
        #from_db_result_set(result_set : ::DB::ResultSet) : Float64 | Nil
        
          Extracts the field value from a DB result set and returns the right object corresponding to this value. 
- 
        #to_column : Management::Column::Base | Nil
        
          Returns a migration column object corresponding to the field at hand. 
- 
        #to_db(value) : ::DB::Any
        
          Converts the field value to the corresponding DB value. 
Instance methods inherited from class Marten::DB::Field::Base
  
  
    
      blank? : Bool
    blank?, 
    
  
    
      db_column
    db_column, 
    
  
    
      db_column! : ::String
    db_column!, 
    
  
    
      db_column?
    db_column?, 
    
  
    
      default
    default, 
    
  
    
      from_db(value)
    from_db, 
    
  
    
      from_db_result_set(result_set : ::DB::ResultSet)
    from_db_result_set, 
    
  
    
      id : String
    id, 
    
  
    
      index? : Bool
    index?, 
    
  
    
      null? : Bool
    null?, 
    
  
    
      prepare_save(record, new_record = false)
    prepare_save, 
    
  
    
      primary_key? : Bool
    primary_key?, 
    
  
    
      related_model
    related_model, 
    
  
    
      relation?
    relation?, 
    
  
    
      relation_name
    relation_name, 
    
  
    
      to_column : Management::Column::Base | Nil
    to_column, 
    
  
    
      to_db(value) : ::DB::Any
    to_db, 
    
  
    
      unique? : Bool
    unique?, 
    
  
    
      validate(record, value)
    validate
    
  
    
  Constructor methods inherited from class Marten::DB::Field::Base
  
  
    
      new(id : ::String, primary_key : ::Bool = false, blank : ::Bool = false, null : ::Bool = false, unique : ::Bool = false, index : ::Bool = false, db_column : ::String | Symbol | Nil = nil)
    new
    
  
    
  
    
    
    
  
    
    
    
  
Constructor Detail
        
        def self.new(id : ::String, primary_key = false, default : Float64 | Nil = nil, blank = false, null = false, unique = false, index = false, db_column = nil)
        #
      
      
      Instance Method Detail
        
        def default : Float64?
        #
      
      
        
              Description copied from class Marten::DB::Field::Base
            
          
          Returns the default value of the field if any.
        
        def from_db(value) : Float64 | Nil
        #
      
      
        
              Description copied from class Marten::DB::Field::Base
            
          
          Converts the raw DB value to the corresponding field value.
        
        def from_db_result_set(result_set : ::DB::ResultSet) : Float64 | Nil
        #
      
      
        
              Description copied from class Marten::DB::Field::Base
            
          
          Extracts the field value from a DB result set and returns the right object corresponding to this value.
        
        def to_column : Management::Column::Base | Nil
        #
      
      
        
              Description copied from class Marten::DB::Field::Base
            
          
          Returns a migration column object corresponding to the field at hand.
        
        def to_db(value) : ::DB::Any
        #
      
      
        
              Description copied from class Marten::DB::Field::Base
            
          
          Converts the field value to the corresponding DB value.