diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-11 15:46:04 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-11 15:46:04 -0300 |
commit | 8a08f5cb236f4ca5458c6bbf87dbde75bfc667be (patch) | |
tree | 204712eb37ef89014da7a7700a5657480d4de4cf | |
parent | d447eef20b674b3fb5da4429af6ee23233ef3d8a (diff) | |
download | rails-8a08f5cb236f4ca5458c6bbf87dbde75bfc667be.tar.gz rails-8a08f5cb236f4ca5458c6bbf87dbde75bfc667be.tar.bz2 rails-8a08f5cb236f4ca5458c6bbf87dbde75bfc667be.zip |
:scissors:
-rw-r--r-- | activerecord/lib/active_record/association_relation.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 4 | ||||
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 6 |
3 files changed, 7 insertions, 7 deletions
diff --git a/activerecord/lib/active_record/association_relation.rb b/activerecord/lib/active_record/association_relation.rb index a17c36ccd9..ef9650d482 100644 --- a/activerecord/lib/active_record/association_relation.rb +++ b/activerecord/lib/active_record/association_relation.rb @@ -8,7 +8,7 @@ module ActiveRecord def proxy_association @association end - + def size @association.size end @@ -16,7 +16,7 @@ module ActiveRecord def empty? @association.empty? end - + private def exec_queries diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 3133f60bcf..7eaa5adc86 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1197,7 +1197,7 @@ class EagerAssociationTest < ActiveRecord::TestCase author = Author.includes(:posts).references(:posts).reorder(:name).find_by('posts.title IS NOT NULL') assert_equal authors(:bob), author end - + test "preloading with a polymorphic association and using the existential predicate but also using a select" do assert_equal authors(:david), authors(:david).essays.includes(:writer).first.writer @@ -1205,7 +1205,7 @@ class EagerAssociationTest < ActiveRecord::TestCase authors(:david).essays.includes(:writer).select(:name).any? end end - + test "preloading with a polymorphic association and using the existential predicate" do assert_equal authors(:david), authors(:david).essays.includes(:writer).first.writer diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index da932b7663..561f6451cd 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -826,14 +826,14 @@ class RelationTest < ActiveRecord::TestCase def test_select_with_aggregates posts = Post.select(:title, :body) - + assert_equal 11, posts.count(:all) assert_equal 11, posts.size assert posts.any? assert posts.many? - assert ! posts.empty? + assert ! posts.empty? end - + def test_select_takes_a_variable_list_of_args david = developers(:david) |