diff options
author | Maximilian Schneider <mail@maximilianschneider.net> | 2012-06-22 16:44:01 +0200 |
---|---|---|
committer | Maximilian Schneider <mail@maximilianschneider.net> | 2012-06-22 16:44:01 +0200 |
commit | f984b8152fb497919b30c9c96e471e0736f3a6d2 (patch) | |
tree | 7d8d56d7e662157a2b6c7c965c42263ebdda5a97 /activerecord/test/cases/finder_respond_to_test.rb | |
parent | 323ee207cbbcd66574045ebedd30765da10d3f6f (diff) | |
download | rails-f984b8152fb497919b30c9c96e471e0736f3a6d2.tar.gz rails-f984b8152fb497919b30c9c96e471e0736f3a6d2.tar.bz2 rails-f984b8152fb497919b30c9c96e471e0736f3a6d2.zip |
made dynamic finders alias_attribute aware
previously dynamic finders only worked in combination with the actual
column name and not its alias defined with #alias_attribute
Diffstat (limited to 'activerecord/test/cases/finder_respond_to_test.rb')
-rw-r--r-- | activerecord/test/cases/finder_respond_to_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/finder_respond_to_test.rb b/activerecord/test/cases/finder_respond_to_test.rb index eedbaac3bd..9440cd429a 100644 --- a/activerecord/test/cases/finder_respond_to_test.rb +++ b/activerecord/test/cases/finder_respond_to_test.rb @@ -36,6 +36,11 @@ class FinderRespondToTest < ActiveRecord::TestCase assert_respond_to Topic, :find_by_title_and_author_name end + def test_should_respond_to_find_all_by_an_aliased_attribute + ensure_topic_method_is_not_cached(:find_by_heading) + assert_respond_to Topic, :find_by_heading + end + def test_should_respond_to_find_or_initialize_from_one_attribute ensure_topic_method_is_not_cached(:find_or_initialize_by_title) assert_respond_to Topic, :find_or_initialize_by_title |