diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2011-07-26 06:33:54 -0700 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2011-07-26 06:33:54 -0700 |
commit | 89f3d8a886ee6d678b60b5e5df4d3a11d93c53d4 (patch) | |
tree | 6850321f2ca38c54eaffdff2f1c03ffcbad33684 /activerecord/test/cases/base_test.rb | |
parent | cfd086a30298aef369d04a7d489d256699fef140 (diff) | |
parent | 04cc446d178653d362510e79a22db5300d463161 (diff) | |
download | rails-89f3d8a886ee6d678b60b5e5df4d3a11d93c53d4.tar.gz rails-89f3d8a886ee6d678b60b5e5df4d3a11d93c53d4.tar.bz2 rails-89f3d8a886ee6d678b60b5e5df4d3a11d93c53d4.zip |
Merge pull request #2271 from slawosz/enhance_select_method_api
allow select to have multiple arguments ie. Post.select(:id,:name,:author)
Diffstat (limited to 'activerecord/test/cases/base_test.rb')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index f2f5b73626..84b66fdf49 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -123,6 +123,11 @@ class BasicsTest < ActiveRecord::TestCase assert_equal Topic.all.map(&:id).sort, topic_ids end + def test_select_symbol_for_many_arguments + topics = Topic.select(:id, :author_name).map{|topic| [topic.id, topic.author_name]}.sort + assert_equal Topic.all.map{|topic| [topic.id,topic.author_name]}.sort, topics + end + def test_table_exists assert !NonExistentTable.table_exists? assert Topic.table_exists? |