Sha256: 20ea4d42b28b4dd85b33f9a0775498d18151204eae8c07f84cb300fa4d93a142

Contents?: true

Size: 742 Bytes

Versions: 20

Compression:

Stored size: 742 Bytes

Contents

module ActiveRecord
  module ConnectionAdapters
    module SQLite3
      module ColumnMethods
        def primary_key(name, type = :primary_key, **options)
          if %i(integer bigint).include?(type) && (options.delete(:auto_increment) == true || !options.key?(:default))
            type = :primary_key
          end

          super
        end
      end

      class TableDefinition < ActiveRecord::ConnectionAdapters::TableDefinition
        include ColumnMethods

        def references(*args, **options)
          super(*args, type: :integer, **options)
        end
        alias :belongs_to :references
      end

      class Table < ActiveRecord::ConnectionAdapters::Table
        include ColumnMethods
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
activerecord-5.1.7 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.7.rc1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.6.2 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.6.1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.6 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.5 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.5.rc1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.4 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.4.rc1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.3 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.3.rc3 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.3.rc2 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.3.rc1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.2 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.2.rc1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.0 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.0.rc2 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.0.rc1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb
activerecord-5.1.0.beta1 lib/active_record/connection_adapters/sqlite3/schema_definitions.rb