Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 37f86aa8f1
Fetching contributors…

Cannot retrieve contributors at this time

25 lines (20 sloc) 0.411 kb
$:.unshift 'lib'
require 'rubygems'
require 'dm-core'
require 'dm-pager'
DataMapper.setup :default, 'sqlite3::memory:'
class Item
include DataMapper::Resource
property :id, Serial
end
def mock_items
DataMapper.auto_migrate!
1.upto 20 do |n|
instance_variable_set :"@item_#{n}", Item.create
end
end
def items from, to
(from..to).map do |n|
instance_variable_get :"@item_#{n}"
end
end
Jump to Line
Something went wrong with that request. Please try again.