Method: Infold::ModelColumnDecorator#code_for_default
- Defined in:
- app/decorators/infold/model_column_decorator.rb
#code_for_default ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 |
# File 'app/decorators/infold/model_column_decorator.rb', line 167 def code_for_default case kind.to_s when 'string' "'#{default}'" when 'boolean' if default.to_s == '0' 'false' elsif default.to_s == '1' 'true' else 'nil' end when 'number' default else 'nil' end end |