Sha256: ca72958191f3aa2c05701db9dad47889b305df40659655ad2ad66b3f36a66898
Contents?: true
Size: 655 Bytes
Versions: 3
Compression:
Stored size: 655 Bytes
Contents
require 'sqlite3' require 'dm-core' require 'dm-core/support/logger' require 'dm-migrations' DataMapper.setup :default, 'sqlite3::memory:' # Define models class Animal include DataMapper::Resource property :id, Serial property :name, String property :notes, Text def self.setup Animal.create(:name => 'Dog', :notes => "Man's best friend") Animal.create(:name => 'Cat', :notes => "Woman's best friend") Animal.create(:name => 'Lion', :notes => 'King of the Jungle') end end # Load fixtures Animal.auto_migrate! Animal.setup if 'irb' == $0 DataMapper.logger.set_log($stdout, :debug) DataMapper.logger.auto_flush = true end
Version data entries
3 entries across 3 versions & 1 rubygems