Flowdock

No documentation

This module has no description. You can help the Ruby on Rails community by adding new notes.

Constants

PostgreSQLColumn = PostgreSQL::Column # :nodoc:

CheckConstraintDefinition = Struct.new(:table_name, :expression, :options) do def name options[:name] end def validate? options.fetch(:validate, true) end alias validated? validate? def export_name_on_schema_dump? !ActiveRecord::SchemaDumper.chk_ignore_pattern.match?(name) if name end def defined_for?(name:, expression: nil, validate: nil, **options) self.name == name.to_s && (validate.nil? || validate == self.options.fetch(:validate, validate)) && options.all? { |k, v| self.options[k].to_s == v.to_s } end end

ForeignKeyDefinition = Struct.new(:from_table, :to_table, :options) do # :nodoc: def name options[:name] end def column options[:column] end def primary_key options[:primary_key] || default_primary_key end def on_delete options[:on_delete] end def on_update options[:on_update] end def deferrable options[:deferrable] end def custom_primary_key? options[:primary_key] != default_primary_key end def validate? options.fetch(:validate, true) end alias validated? validate? def export_name_on_schema_dump? !ActiveRecord::SchemaDumper.fk_ignore_pattern.match?(name) if name end def defined_for?(to_table: nil, validate: nil, **options) (to_table.nil? || to_table.to_s == self.to_table) && (validate.nil? || validate == self.options.fetch(:validate, validate)) && options.all? { |k, v| Array(self.options[k]).map(&:to_s) == Array(v).map(&:to_s) } end private def default_primary_key "id" end end

PrimaryKeyDefinition = Struct.new(:name)

CreateIndexDefinition = Struct.new(:index, :algorithm, :if_not_exists)

ChangeColumnDefaultDefinition = Struct.new(:column, :default)

ChangeColumnDefinition = Struct.new(:column, :name)

AddColumnDefinition = Struct.new(:column)

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type) do # :nodoc: self::OPTION_NAMES = [ :limit, :precision, :scale, :default, :null, :collation, :comment, :primary_key, :if_exists, :if_not_exists ] def primary_key? options[:primary_key] end (self::OPTION_NAMES - [:primary_key]).each do |option_name| module_eval <<-CODE, __FILE__, __LINE__ + 1 def #{option_name} options[:#{option_name}] end def #{option_name}=(value) options[:#{option_name}] = value end CODE end def aliased_types(name, fallback) "timestamp" == name ? :datetime : fallback end end

Attributes

Show files where this module is defined (82 files)
Register or log in to add new notes.