Files
danbooru/app/models/removed_post.rb
albert 694b6f0813 sync
2010-08-18 18:44:18 -04:00

22 lines
612 B
Ruby

class RemovedPost < ActiveRecord::Base
module RemovalMethods
def unremove!
Post.transaction do
execute_sql("INSERT INTO posts (#{Post.column_names.join(', ')}) SELECT #{Post.column_names.join(', ')} FROM removed_posts WHERE id = #{id}")
execute_sql("DELETE FROM removed_posts WHERE id = #{id}")
end
end
end
include Post::FileMethods
include Post::ImageMethods
include Post::TagMethods
include Post::SearchMethods
include Post::UploaderMethods
include Post::PoolMethods
include Post::CountMethods
include Post::CacheMethods
include RemovalMethods
end