Mar
26
2010

Supermodel: Simple ActiveModel-Powered In-Memory Models

Supermodel is a new library by Alex Maccaw that uses the Rails 3.0 ActiveModel library to provide ActiveRecord-esque in-memory "database" storage in Ruby.

Supermodel is best demonstrated with a basic example:

require 'supermodel'

class Person < SuperModel::Base; end

a = Person.new( :name => "Jim" )
a.save

Person.find_by_name('Jim') # => #<Person>
Person.all # => [#<Person>]
read more...

WEBSITE COPYRIGHT © 2013 | bestwebmagazine.com