sanitize_sql_hash_for_assignment

sanitize_sql_hash_for_assignment(attrs, table) Instance Protected methods Sanitizes a hash of attribute/value pairs into SQL conditions for a SET clause. { status: nil, group_id: 1 } # => "status = NULL , group_id = 1"

sanitize_sql_hash_for_conditions

sanitize_sql_hash_for_conditions(attrs, default_table_name = self.table_name) Instance Protected methods Sanitizes a hash of attribute/value pairs into SQL conditions for a WHERE clause. { name: "foo'bar", group_id: 4 } # => "name='foo''bar' and group_id= 4" { status: nil, group_id: [1,2,3] } # => "status IS NULL and group_id IN (1,2,3)" { age: 13..18 } # => "age BETWEEN 13 AND 18" { 'other_records.id' => 7 } # => "`other_records`.`id` = 7" { other_records: {

quoted_id

quoted_id() Instance Public methods TODO: Deprecate this

define

define(info={}, &block) Class Public methods Eval the given block. All methods available to the current connection adapter are available within the block, so you can easily use the database definition DSL to build up your schema (create_table, add_index, etc.). The info hash is optional, and if given is used to define metadata about the current schema (currently, only the schema's version): ActiveRecord::Schema.define(version: 20380119000001) do ... end

migrations_paths

migrations_paths() Instance Public methods Returns the migrations paths. ActiveRecord::Schema.new.migrations_paths # => ["db/migrate"] # Rails migration path by default.

create_table

create_table(limit=nil) Class Public methods

drop_table

drop_table() Class Public methods

index_name

index_name() Class Public methods

normalize_migration_number

normalize_migration_number(number) Class Public methods

primary_key

primary_key() Class Public methods