DataMapper
dm-is-vers
USAGE:
以下のコードをご覧の通りです。
1 class Story 2 include DataMapper::Resource 3 4 property :id, Integer, :serial => true 5 property :title, String 6 property :updated_at , DateTime 7 8 has_versio ns :ignore => [:updated_at ] 9 end 10 11 Story.auto_upgra de! 12 13 story = Story.create(:title => 'hello') 14 story.version #=> 0 15 story.update_att ributes :title => 'good night' 16 story.version #=> 1 17 story.title #=> 'good night' 18 story.version = 0 19 story.title #=> 'hello'
auto_upgra
posted by
genki
on Fri 16 Jan 2009
at 03:42