This is HyperactiveRecord, a not-at-all drop-in replacement for ActiveRecord::Base
It uses archipelago for persistence, and is meaningful only in an environment where the server process doesnt restart at each request. This means that cgi environment is not really an option.
Dependencies:
- Hyperactive::Tree
Sub packages:
- Hyperactive::Record
-
The base class itself, providing you with cached selectors and rejectors, along with cached finders for any number of attributes.
- Hyperactive::Tree
-
A collection class that contains any number of Hyperactive::Records in a tree structure. Scales logarithmically, so use with care.
Examples:
To define a Record subclass that has the properties @active and @city that are indexed in two ways:
class MyClass < Hyperactive::Record
attr_accessor :active, :city
select(:active_records, Proc.new do |record|
record.active == true
end)
index_by(:city)
end
This will allow you to find all active MyClass instances by:
MyClass.active_records
Or finding all MyClass instances connected to Stockholm by:
MyClass.find_by_city("Stockholm")