历史资源模型修改

This commit is contained in:
lizanle 2015-12-30 10:32:32 +08:00
parent fd4d2910d0
commit 90c63192e6
4 changed files with 15 additions and 3 deletions

View File

@ -519,6 +519,10 @@ class Attachment < ActiveRecord::Base
end
end
#更新文件的版本
def update_attchment_version
end
private
# Physically deletes the file from the file system

View File

@ -1,3 +1,3 @@
class AttachmentHistory < ActiveRecord::Base
belongs_to :attachment,foreign_key: 'attach_id'
belongs_to :attachment,foreign_key: 'attachment_id'
end

View File

@ -0,0 +1,8 @@
class RenameAttachmentHistoriesColumnVersionIdToAttachmentId < ActiveRecord::Migration
def up
rename_column :attachment_histories,:version_id,:attachment_id
end
def down
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20151229045505) do
ActiveRecord::Schema.define(:version => 20151230022443) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -98,7 +98,7 @@ ActiveRecord::Schema.define(:version => 20151229045505) do
t.integer "copy_from"
t.integer "quotes"
t.integer "version"
t.integer "version_id"
t.integer "attachment_id"
end
create_table "attachments", :force => true do |t|