- ActiveRecord RDoc
- ActiveRecord Project
- How to Create New Database Adapter for Rails on Rails Wiki
- Rails Home Page
Class ActiveRecord::Schema < Migration
In: lib/active_record/schema.rb
Allows programmers to programmatically define a schema in a portable DSL. This means you can define tables, indexes, etc. without using SQL directly, so your applications can more easily support multiple databases.
Class ActiveRecord::Observer < Object
In: lib/active_record/observer.rb
Observer classes respond to lifecycle callbacks to implement trigger-like behavior outside the original class. This is a great way to reduce the clutter that normally comes when the model class is burdened with functionality that doesn’t pertain to the core responsibility of the class. Example:
class CommentObserver < ActiveRecord::Observer
def after_save(comment)
Notifications.deliver_comment("admin@do.com", "New comment was posted", comment)
end
end
Class ActiveRecord::ConnectionAdapters::AbstractAdapter < Object
In: lib/active_record/connection_adapters/abstract_adapter.rb
All the concrete database adapters follow the interface laid down in this class. You can use this interface directly by borrowing the database connection from the Base with Base.connection.
Included Modules
- Quoting
- quote
- quote_column_name (highly adapter specific)
- quote_string
- quoted_date
- quoted_false
- quoted_true
- DatabaseStatements (DML related)
- SchemaStatements (DDL related)
- add_column
- add_index
- change_column
- change_column_default
- columns
- create_table
- drop_table
- initialize_schema_information
- native_database_types : map rails' data type(:date, :text, etc.) to database's data type
- remove_column
- remove_index
- rename_column
- rename_table
- structure_dump
- table_alias_for
- table_alias_length
These 3 modules should be overridden by sub-class of AbstractAdapter.
Included Classes
Class ActiveRecord::ConnectionAdapters::Column < Object
In: lib/active_record/connection_adapters/abstract/schema_definitions.rb
An abstract definition of a column in a table.
Methods
No comments:
Post a Comment