Datamapper update enum
My model looks like this:
class Project
include DataMapper::Resource
property :id, Serial
property :title, String
property :slug, Stri开发者_C百科ng
property :status, Enum[:open, :closed ], :default => :open
has n, :issues
end
How do I use Project.update() to change the status of the enum to closed?
Just like that:
Project.update(:status => :closed)
精彩评论