Sha256: e3a51d523d2d164440690608746df30af9e53acb297a71e0af0f48d631f03eea

Contents?: true

Size: 754 Bytes

Versions: 23

Compression:

Stored size: 754 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    class SQLServerColumn < Column

      def initialize(name, default, sql_type_metadata = nil, null = true, table_name = nil, default_function = nil, collation = nil, comment = nil, sqlserver_options = {})
        @sqlserver_options = sqlserver_options || {}
        super(name, default, sql_type_metadata, null, table_name, default_function, collation, comment: comment)
      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 case_sensitive?
        collation && collation.match(/_CS/)
      end

    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
activerecord-jdbcsqlserver-adapter-52.0.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-jdbcsqlserver-adapter-51.1.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-jdbcsqlserver-adapter-50.1.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.2.1 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-jdbcsqlserver-adapter-51.0.1 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-jdbcsqlserver-adapter-51.0.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-jdbcsqlserver-adapter-50.0.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.2.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.2.0.rc2 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.2.0.rc1 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.1.6 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.0.8 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.1.5 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.1.2 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.1.1 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.1.0 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.0.7 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.0.6 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.0.5 lib/active_record/connection_adapters/sqlserver_column.rb
activerecord-sqlserver-adapter-5.0.4 lib/active_record/connection_adapters/sqlserver_column.rb