Sha256: ed9bf093a56aee51306f9830bbc66d240e78dbeca8b8d530860156b5f516b086
Contents?: true
Size: 570 Bytes
Versions: 10
Compression:
Stored size: 570 Bytes
Contents
class BazaModels::Model::ActiveRecordColumnAdapater def initialize(baza_column) @baza_column = baza_column end def name @baza_column.name end def null @baza_column.null? end def sql_type result = @baza_column.type.to_s.clone result << "(#{@baza_column.maxlength})" if @baza_column.maxlength result end def type case @baza_column.type when :int :integer when :tinyint :boolean when :varchar, :string, :text :string else raise "Unknown type: #{@baza_column.type}" end end end
Version data entries
10 entries across 10 versions & 1 rubygems