<commit_before>module ActiveRecord
  module ConnectionAdapters
    module ColumnMethods
      # Adds geometry type for migrations. So you can add column to a table like:
      #   create_table :locations do |t|
      #     ...
      #     t.geometry :geom, srid: 423, type: 'LINESTRING', dimension: 2
      #     ...
      #   end
      #
      def geometry(name, options = {})
        column(name, :geometry, options)
      end
    end

    class TableDefinition
      include ColumnMethods
    end

    class Table
      include ColumnMethods
    end
  end
end
<commit_msg>Alias chaining TableDefinition#column to support spatial options.<commit_after>module ActiveRecord
  module ConnectionAdapters
    module ColumnMethods
      # Adds geometry type for migrations. So you can add column to a table like:
      #   create_table :locations do |t|
      #     ...
      #     t.geometry :geom, srid: 423, type: 'LINESTRING', dimension: 2
      #     ...
      #   end
      #
      def geometry(name, options = {})
        column(name, :geometry, options)
      end
    end

    class PostgreSQLAdapter::ColumnDefinition < ActiveRecord::ConnectionAdapters::ColumnDefinition
      attr_accessor :srid, :spatial_type, :dimension
    end

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

      def column_with_spatial(name, type = nil, options = {})
        column = column_without_spatial(name, type, options)[name]
        column.srid = options[:srid]
        column.spatial_type = options[:type]
        column.dimension = options[:dimension]
        self
      end

      alias_method_chain :column, :spatial
    end

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

{'fraction_non_alphanumeric': 0.07962657880285558, 'fraction_numerical': 0.004393190554640308, 'mean_word_length': 2.5725490196078433, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1570364', 'n_tokens_mistral': 515, 'n_tokens_neox': 489, 'n_words': 142}