Add loot content-type
git-svn-id: file:///home/svn/framework3/trunk@8667 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
3b0c82b131
commit
1fff5f447f
|
@ -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
|
||||
|
|
@ -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!
|
||||
|
||||
|
|
Loading…
Reference in New Issue