Sha256: 49c73ecae95af53fecc74991063d0c293236da5ff534bf4ae766cde25d6961d1
Contents?: true
Size: 976 Bytes
Versions: 6
Compression:
Stored size: 976 Bytes
Contents
module ActiveRecord module ConnectionAdapters class SQLServerColumn < Column def initialize(name, default, cast_type, sql_type = nil, null = true, sqlserver_options = {}) super(name, default, cast_type, sql_type, null) @sqlserver_options = sqlserver_options.symbolize_keys @default_function = @sqlserver_options[:default_function] end def sql_type_for_statement if is_integer? || is_real? sql_type.sub(/\((\d+)?\)/, '') else sql_type end end def table_name @sqlserver_options[:table_name] end def is_identity? @sqlserver_options[:is_identity] end def is_primary? @sqlserver_options[:is_primary] end def is_utf8? @sql_type =~ /nvarchar|ntext|nchar/i end def is_integer? @sql_type =~ /int/i end def is_real? @sql_type =~ /real/i end end end end
Version data entries
6 entries across 6 versions & 1 rubygems