mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Failing test for aggregating on default_scope with select
This commit is contained in:
committed by
Jon Leighton
parent
dfaad4f5a7
commit
a5806fa409
@@ -471,6 +471,10 @@ class DefaultScopingTest < ActiveRecord::TestCase
|
||||
assert_equal 10, DeveloperCalledJamis.unscoped.poor.length
|
||||
end
|
||||
|
||||
def test_default_scope_select_ignored_by_aggregations
|
||||
assert_equal DeveloperWithSelect.all.count, DeveloperWithSelect.count
|
||||
end
|
||||
|
||||
def test_default_scope_order_ignored_by_aggregations
|
||||
assert_equal DeveloperOrderedBySalary.all.count, DeveloperOrderedBySalary.count
|
||||
end
|
||||
|
||||
@@ -86,6 +86,11 @@ class DeveloperWithBeforeDestroyRaise < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
class DeveloperWithSelect < ActiveRecord::Base
|
||||
self.table_name = 'developers'
|
||||
default_scope select('name')
|
||||
end
|
||||
|
||||
class DeveloperOrderedBySalary < ActiveRecord::Base
|
||||
self.table_name = 'developers'
|
||||
default_scope :order => 'salary DESC'
|
||||
|
||||
Reference in New Issue
Block a user