2010-11-29 4 views
0

私のモデルは次のようになります。DataMapperの更新列挙

class Project 
    include DataMapper::Resource 
    property :id, Serial 
    property :title, String 
    property :slug, String 
    property :status, Enum[:open, :closed ], :default => :open 
    has n, :issues 
end 

は、どのように私はclosedに列挙型のステータスを変更する)(Project.updateを使用していますか?ちょうどそのような

答えて

2

Project.update(:status => :closed)