dkubb (owner)

Revisions

gist: 215552 Download_button fork
public
Public Clone URL: git://gist.github.com/215552.git
Embed All Files: show embed
Resource#== results #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env ruby -Ku
 
# encoding: utf-8
 
require 'rubygems'
require 'dm-core'
 
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, 'sqlite3::memory:')
 
class Post
  include DataMapper::Resource
 
  property :id, Serial
  property :title, String
end
 
DataMapper.auto_migrate!
 
puts '-' * 132
 
p1 = Post.new
p2 = p1.dup
p p1 == p2 # => true (correct)
 
p2.title = "x"
p p1 == p2 # => false (correct)