This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 280fbe10314d406f9fde953eb508f8abf41ed36c
tree 1250398867be83ab716e707e0c306da751283230
parent 3f7188f94833d125d7803c6fb93746e28a4750fd
tree 1250398867be83ab716e707e0c306da751283230
parent 3f7188f94833d125d7803c6fb93746e28a4750fd
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Thu Oct 02 11:52:21 -0700 2008 | |
| |
MIT-LICENSE | Thu Oct 02 11:52:21 -0700 2008 | |
| |
README.rdoc | ||
| |
Rakefile | Thu Oct 02 11:55:06 -0700 2008 | |
| |
init.rb | ||
| |
lib/ | ||
| |
rdoc/ |
README.rdoc
PassiveRecord
PassiveRecord provides ActiveRecord-like behavior for static, non-database models.
PassiveRecord was developed by Art of Mission, Inc. for Sharp Sync, a new product by Ministry Centered Technologies
Installation
Download PassiveRecord from Github: github.com/artofmission/passive_record
Install using Git Submodules:
git submodule add http://github.com/artofmission/passive_record vendor/plugins/passive_record git submodule init git submodule update
Install with Rails’ plugin installer
./script/plugin install git://github.com/artofmission/passive_record.git
Example
class Name < PassiveRecord::Base
define_fields [:first_name, :middle_name, :last_name]
end
…will create a new Name model with id, address, and location attributes.
class Person < PassiveRecord::Base
has_many :names
end
@person = Person.new(:names => [Name.new(:first_name => "Dima", :last_name => "Dozen")])
This would a Person object that has many names. You can now access the names hash just like you would an ActiveRecord object.
@person.names #=> [#<Name:0x2031824 @last_name="Dozen", @first_name="Dima">]
You can serialize a PassiveRecord object into another database object for storage:
class Address < PassiveRecord::Base
define_fields [:street, :city, :state, :postal_code, :country]
end
class Company < ActiveRecord
serialize :address
end
@company.address = Address.new(:street1 => "123 4th St", :city => "Wellington", :country => "NZ")
Resources for Non-ActiveRecord models
Due Credit
- Ministry Centered Technologies created the need
- Ryan Heneise of Art of Mission, Inc. wrote the code
Contributors
- felipemesquita (github.com/felipemesquita)
Copyright © 2008 Ryan Heneise, released under the MIT license








