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 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 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 == options.fetch(:validate, validate)) && options.all? { |k, v| self.options[k].to_s == v.to_s } end private def default_primary_key "id" end end

PrimaryKeyDefinition = Struct.new(:name)

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

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

AddColumnDefinition = Struct.new(:column)

ColumnDefinition = Struct.new(:name, :type, :options, :sql_type) do # :nodoc: def primary_key? options[:primary_key] end [:limit, :precision, :scale, :default, :null, :collation, :comment].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 (74 files)
Register or log in to add new notes.