Skip to content

Instantly share code, notes, and snippets.

@piyushranjan
Created May 4, 2010 13:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save piyushranjan/389380 to your computer and use it in GitHub Desktop.
Save piyushranjan/389380 to your computer and use it in GitHub Desktop.
require "dm-core"
DataMapper::Logger.new($stdout, :debug)
DataMapper.setup(:default, 'mysql://test@localhost/dm_test')
class Amount
include DataMapper::Resource
property :id, Serial
property :amount_1, Integer
property :amount_2, Integer
end
DataMapper.auto_migrate!
Amount.create(:amount_1 => 10, :amount_2 => 20)
Amount.create(:amount_1 => 20, :amount_2 => 20)
p Amount.all(:amount_1.eql => :amount_2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment