From 44a82ec3d7bd197113520f9b81993c9f700c44c8 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Fri, 15 Feb 2008 21:20:47 +0000 Subject: [PATCH] ActionItem154: minor refactoring --- app/models/members_block.rb | 4 ---- app/models/profile_list_block.rb | 3 +++ test/unit/profile_list_block_test.rb | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/models/members_block.rb b/app/models/members_block.rb index 483e6e7..c5ddb13 100644 --- a/app/models/members_block.rb +++ b/app/models/members_block.rb @@ -37,10 +37,6 @@ class MembersBlock < ProfileListBlock result end - def pick_random(top) - rand(top) - end - end diff --git a/app/models/profile_list_block.rb b/app/models/profile_list_block.rb index 834743f..13cc735 100644 --- a/app/models/profile_list_block.rb +++ b/app/models/profile_list_block.rb @@ -31,6 +31,9 @@ class ProfileListBlock < Block def find Profile.find(:all, :limit => block.limit, :order => 'created_at desc') end + def pick_random(top) + rand(top) + end end def profiles diff --git a/test/unit/profile_list_block_test.rb b/test/unit/profile_list_block_test.rb index b2580b1..6855280 100644 --- a/test/unit/profile_list_block_test.rb +++ b/test/unit/profile_list_block_test.rb @@ -25,7 +25,6 @@ class ProfileListBlockTest < Test::Unit::TestCase owner.boxes.first.blocks << block block.save! - # faking that we are picking random people profiles = [person1, person3] block.expects(:profiles).returns(profiles) -- libgit2 0.21.2