clean up job listing, bug fixes

This commit is contained in:
albert
2013-02-17 23:16:56 -05:00
parent 1b780e27ab
commit 2af59642f6
6 changed files with 12 additions and 6 deletions

View File

@@ -532,14 +532,14 @@ class Post < ActiveRecord::Base
def add_pool!(pool)
return if belongs_to_pool?(pool)
self.pool_string = "#{pool_string} pool:#{pool.id}".strip
update_column(:pool_string, pool_string)
update_column(:pool_string, pool_string) unless new_record?
pool.add!(self)
end
def remove_pool!(pool)
return unless belongs_to_pool?(pool)
self.pool_string = pool_string.gsub(/(?:\A| )pool:#{pool.id}(?:\Z| )/, " ").strip
update_column(:pool_string, pool_string)
update_column(:pool_string, pool_string) unless new_record?
pool.remove!(self)
end
end