diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-03-06 18:36:30 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-03-06 18:36:30 +0000 |
commit | 4863634a157a8e4a0033734617253b42325daf34 (patch) | |
tree | 0a13efa3a7a983731f48886dc6ddfa41781aae6f /activerecord/test/cases | |
parent | c896d56c6e5520346c260477f7d7f8bf951e72cc (diff) | |
download | rails-4863634a157a8e4a0033734617253b42325daf34.tar.gz rails-4863634a157a8e4a0033734617253b42325daf34.tar.bz2 rails-4863634a157a8e4a0033734617253b42325daf34.zip |
Ensure supplie :from has precedence over scoped :from [#1370 state:resolved]
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/finder_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_test.rb b/activerecord/test/cases/finder_test.rb index ee8f4901f9..9d444a92ae 100644 --- a/activerecord/test/cases/finder_test.rb +++ b/activerecord/test/cases/finder_test.rb @@ -1057,6 +1057,14 @@ class FinderTest < ActiveRecord::TestCase assert_equal [0, 1, 1], posts.map(&:author_id).sort end + def test_finder_with_scoped_from + all_topics = Topic.all + + Topic.with_scope(:find => { :from => 'fake_topics' }) do + assert_equal all_topics, Topic.all(:from => 'topics') + end + end + protected def bind(statement, *vars) if vars.first.is_a?(Hash) |