Sha256: 9b342b91ab5cafe90464fbf28c8d3fb84ddbdb5c82ca6fbb98cfe0902397b587

Contents?: true

Size: 441 Bytes

Versions: 18

Compression:

Stored size: 441 Bytes

Contents

# frozen_string_literal: true

module Thredded
  class BaseMigration < (Thredded.rails_gte_51? ? ActiveRecord::Migration[5.1] : ActiveRecord::Migration)
    def user_id_type
      Thredded.user_class.columns.find { |c| c.name == Thredded.user_class.primary_key }.sql_type
    end

    def column_type(table, column_name)
      column_name = column_name.to_s
      columns(table).find { |c| c.name == column_name }.sql_type
    end
  end
end

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
threddedDANIEL-0.14.5 lib/thredded/base_migration.rb
thredded-0.14.4 lib/thredded/base_migration.rb
thredded-0.14.3 lib/thredded/base_migration.rb
thredded-0.14.2 lib/thredded/base_migration.rb
thredded-0.14.1 lib/thredded/base_migration.rb
thredded-0.14.0 lib/thredded/base_migration.rb
thredded-0.13.8 lib/thredded/base_migration.rb
thredded-0.13.7 lib/thredded/base_migration.rb
thredded-0.13.6 lib/thredded/base_migration.rb
thredded-0.13.5 lib/thredded/base_migration.rb
thredded-0.13.4 lib/thredded/base_migration.rb
thredded-0.13.3 lib/thredded/base_migration.rb
thredded-0.13.2 lib/thredded/base_migration.rb
thredded-0.13.1 lib/thredded/base_migration.rb
thredded-0.13.0 lib/thredded/base_migration.rb
thredded-0.12.4 lib/thredded/base_migration.rb
thredded-0.12.3 lib/thredded/base_migration.rb
thredded-0.12.2 lib/thredded/base_migration.rb