Active Record are like Object Relational Mapping(ORM), where classes are mapped to table , objects are mapped to columns and object attributes are mapped to data in the table
SRuby Supports only Single Inheritance.
You can achieve Multiple Inheritance through MIXIN concept means you achieve using module by including it with classes.
- (-) save
- (-) valid
- (1) before_validation
- (2) before_validation_on_create
- (-) validate
- (-) validate_on_create
- (3) after_validation
- (4) after_validation_on_create
- (5) before_save
- (6) before_create
- (-) create
- (7) after_create
- (8) after_save
- rename_table(old_name, new_name)
- add_column(table_name,column_name, type, options)
- rename_column(table_name,column_name, new_column_name)
- change_column(table_name, column_name, type, options)
- add_index(table_name,column_name, index_type)
Migrations support all the basic data types: string, text, integer, float, datetime, timestamp, time, date, binary and boolean:
- string - is for small data types such as a title.
- text - is for longer pieces of textual data, such as the description.
- integer- is for whole numbers.
- float- is for decimals.
- datetime and timestamp - store the date and time into a column.
- date and time - store either the date only or time only.
- binary - is for storing data such as images, audio, or movies.
- boolean - is for storing true or false values.
Valid column options are:
- limit ( :limit => “50” )
- default (:default => “blah” )
- null (:null => false implies NOT NULL)
Methods that return a boolean result are typically named with a ending question mark. For example: def active? return true #just always returning true end.