Sha256: 8b81013b73d12ae5a89e7f48014b5f54dd226e021ea8f6ef5ef8fd9f03bcb7d6
Contents?: true
Size: 862 Bytes
Versions: 13
Compression:
Stored size: 862 Bytes
Contents
require 'pathname' root_path = Pathname(__FILE__).dirname.join('..').expand_path lib_path = root_path.join('lib') $:.unshift(lib_path) require 'toy' require 'adapter/memory' class Address include Toy::Store store :memory, {} attribute :city, String attribute :state, String attribute :zip, String index :zip end class PhoneNumber include Toy::Store attribute :area_code, String attribute :number, String end class Company include Toy::Store store :memory, {} attribute :name, String end class User include Toy::Store store :memory, {} attribute :name, String attribute :age, Integer attribute :admin, Boolean, :default => false attribute :ssn, String timestamps index :ssn list :addresses, :dependendent => true reference :employer, Company # validations and callbacks are available too end
Version data entries
13 entries across 13 versions & 1 rubygems