sanitize_css

sanitize_css(style) Instance Public methods Sanitizes a block of css code. Used by sanitize when it comes across a style attribute

app

app() Instance Public methods Returns the underlying rack application for this engine.

first!

first!() Instance Public methods Same as first but raises ActiveRecord::RecordNotFound if no record is found. Note that first! accepts no arguments.

add_index

add_index(table_name, column_name, options = {}) Instance Public methods Adds a new index to the table. column_name can be a single Symbol, or an Array of Symbols. The index will be named after the table and the column name(s), unless you pass :name as an option. Creating a simple index add_index(:suppliers, :name) generates: CREATE INDEX suppliers_name_index ON suppliers(name) Creating a unique index add_index(:accounts, [:branch_id, :party_id], unique: true) generates: CREATE

url_for

url_for(options = {}) Class Public methods

rename_table

rename_table(table_name, new_name) Instance Public methods Renames a table. Example: rename_table('octopuses', 'octopi')

assume_migrated_upto_version

assume_migrated_upto_version(version, migrations_paths = ActiveRecord::Migrator.migrations_paths) Instance Public methods

write

write(object, options = {}) Instance Public methods

change_column_null

change_column_null(table_name, column_name, null, default = nil) Instance Public methods Sets or removes a +NOT NULL+ constraint on a column. The null flag indicates whether the value can be NULL. For example change_column_null(:users, :nickname, false) says nicknames cannot be NULL (adds the constraint), whereas change_column_null(:users, :nickname, true) allows them to be NULL (drops the constraint). The method accepts an optional fourth argument to replace existing +NULL+s wit

table_alias_length

table_alias_length() Instance Public methods Returns the maximum length of a table alias.