diff --git a/app/models/pool.rb b/app/models/pool.rb index 13e488ba8..eaae96384 100644 --- a/app/models/pool.rb +++ b/app/models/pool.rb @@ -118,23 +118,6 @@ class Pool < ApplicationRecord end end - def self.id_to_name(id) - select_value_sql("SELECT name FROM pools WHERE id = ?", id) - end - - def self.options - select_all_sql("SELECT id, name FROM pools WHERE is_active = true AND is_deleted = false ORDER BY name LIMIT 100").map {|x| [x["name"].tr("_", " "), x["id"]]} - end - - def self.create_anonymous - Pool.new do |pool| - pool.name = "TEMP:#{Time.now.to_f}.#{rand(1_000_000)}" - pool.save - pool.name = "anon:#{pool.id}" - pool.save - end - end - def self.normalize_name(name) name.gsub(/\s+/, "_") end diff --git a/test/unit/pool_test.rb b/test/unit/pool_test.rb index e2aca70a0..35651a5ba 100644 --- a/test/unit/pool_test.rb +++ b/test/unit/pool_test.rb @@ -53,10 +53,6 @@ class PoolTest < ActiveSupport::TestCase should "be mapped to a pool id" do assert_equal(@pool.id, Pool.name_to_id(@pool.id.to_s)) end - - should "be mapped to its name" do - assert_equal(@pool.name, Pool.id_to_name(@pool.id)) - end end context "Reverting a pool" do @@ -317,16 +313,4 @@ class PoolTest < ActiveSupport::TestCase assert_nil(@p3_neighbors.next) end end - - context "An anonymous pool" do - setup do - user = Timecop.travel(1.month.ago) {FactoryGirl.create(:user)} - CurrentUser.user = user - end - - should "have a name starting with anon" do - pool = Pool.create_anonymous - assert_match(/^anon:\d+$/, pool.name) - end - end end