今回は Transaction 機能について. 公式サイト http://datamapper.org/doku.php?id=docs:transactions 環境 dm-core-0.9.11 モデル定義 class Account include DataMapper::Resource property :id, Serial property :name, String, :nullable => false property :amount, Integer, :default => 0 # ↑本来なら BigDecimal validates_with_method :amount, :method => :check_amount def check_amount if 0 <= self.amount then true else [false, "can't spec