Sha256: cc406d0b5d329d58690d4f7af1b730f36a78c0e2119f6285fcb7431873fcc567
Contents?: true
Size: 817 Bytes
Versions: 2
Compression:
Stored size: 817 Bytes
Contents
# GORM https://github.com/jinzhu/gorm require "ar2gostruct/builder/orm/base" module Ar2gostruct module Builder module ORM class GORM < Base TAG_SEPARATOR = ";" def get_option(col) orm_option = [] # not null Constraint unless col.null orm_option << "not null" end # set size if col.type == :string # SQL type if col.sql_type && /\A\w+\(\d+\)/.match(col.sql_type) orm_option << "type:#{col.sql_type}" end orm_option << "size:#{col.limit}" if col.limit end if orm_option.present? return "sql:\"#{orm_option.join(TAG_SEPARATOR)}\"" else return nil end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
ar2gostruct-0.2.2 | lib/ar2gostruct/builder/orm/gorm.rb |
ar2gostruct-0.2.1 | lib/ar2gostruct/builder/orm/gorm.rb |