From 6f05696ceb2fe21b735c428c96c228705fc4c6c5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Thu, 14 Jul 2005 07:18:26 +0000 Subject: Added :select option to find which can specify a different value than the default *, like find(:all, :select => "first_name, last_name"), if you either only want to select part of the columns or exclude columns otherwise included from a join #1338 [Stefan Kaes] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1830 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/finder_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb index 61400f2772..2f23503ce1 100644 --- a/activerecord/test/finder_test.rb +++ b/activerecord/test/finder_test.rb @@ -93,6 +93,10 @@ class FinderTest < Test::Unit::TestCase Topic.find(2).parent end + + def test_find_only_some_columns + assert_raises(NoMethodError) { Topic.find(1, :select => "author_name").title } + end def test_find_on_conditions assert Topic.find(1, :conditions => "approved = 0") -- cgit v1.2.3