finished post unit tests; added pool/tag alias/tag implication stub code

This commit is contained in:
albert
2010-02-11 23:15:31 -05:00
parent bed94a4e30
commit cdc1f653b6
8 changed files with 1254 additions and 291 deletions

View File

@@ -2,7 +2,7 @@ class Pool < ActiveRecord::Base
validates_uniqueness_of :name
validates_presence_of :name
validates_format_of :name, :with => /\A[^\s;,]+\Z/, :on => :create, :message => "cannot have whitespace, commas, or semicolons"
belongs_to :creator, :class_name => "Person"
belongs_to :creator, :class_name => "User"
def self.create_anonymous(creator)
pool = Pool.create(:name => "TEMP - #{Time.now.to_f}.#{rand(1_000_000)}", :creator => creator)
@@ -14,7 +14,7 @@ class Pool < ActiveRecord::Base
post_ids =~ /\A#{post.id} (\d+)|(\d+) #{post.id} (\d+)|(\d+) #{post.id}\Z/
if $2 && $3
{:previous => $2.to_i, :next = $3.to_i}
{:previous => $2.to_i, :next => $3.to_i}
elsif $1
{:previous => $1.to_i}
elsif $4