src code

class method ActiveRecord.create

ActiveRecord.create(table_name[,fields][,instance_methods]) → ActiveRecord.Model
ActiveRecord.create(options[,fields][,instance_methods]) → ActiveRecord.Model

Creates an ActiveRecord class, returning the class and storing it inside ActiveRecord.Models[model_name]. model_name is a singularized, capitalized form of table name.

var User = ActiveRecord.create('users',{
    id: 0,
    name: ''
});
var u = User.find(5);

The fields hash should consist of column name, default value pairs. If an empty array or empty object is set as the default, any arbitrary data can be set and will automatically be serialized when saved. To specify a specific type, set the value to an object that contains a "type" key, with optional "length" and "value" keys.