refactored anon pools

This commit is contained in:
albert
2011-09-16 19:01:40 -04:00
parent d664cca4a4
commit f56ae86b5b
3 changed files with 9 additions and 13 deletions

View File

@@ -24,10 +24,9 @@ class Pool < ActiveRecord::Base
select_value_sql("SELECT name FROM pools WHERE id = ?", id)
end
def self.create_anonymous(creator, creator_ip_addr)
def self.create_anonymous
Pool.new do |pool|
pool.name = "TEMP:#{Time.now.to_f}.#{rand(1_000_000)}"
pool.creator = creator
pool.save
pool.name = "anon:#{pool.id}"
pool.save