Add loot content-type

git-svn-id: file:///home/svn/framework3/trunk@8667 4d416f70-5f16-0410-b530-b9f4589650da
This commit is contained in:
HD Moore 2010-02-26 19:33:49 +00:00
parent 3b0c82b131
commit 1fff5f447f
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,10 @@
class AddLootsCtype < ActiveRecord::Migration
def self.up
add_column :loots, :content_type, :string
end
def self.down
remove_column :loots, :content_type
end
end

View File

@ -767,6 +767,8 @@ class DBManager
end
ltype = opts.delete(:type) || opts.delete(:ltype) || return
ctype = opts.delete(:ctype) || opts.delete(:content_type) || 'text/plain'
data = opts[:data]
loot = wspace.loots.new
@ -779,6 +781,7 @@ class DBManager
loot.path = path
loot.ltype = ltype
loot.ctype = ctype
loot.data = data
loot.save!