diff options
author | Michael Koziarski <michael@koziarski.com> | 2008-01-27 02:41:55 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2008-01-27 02:41:55 +0000 |
commit | 9500ad5fbc337d881dc953631f6d808ad08774c1 (patch) | |
tree | 368267c053dc6d0c18c0c0a04d76bcdd6bcf9292 /activerecord/lib/active_record/associations.rb | |
parent | f11904ad6d0d9981dfb54b8fe07bfa908607db35 (diff) | |
download | rails-9500ad5fbc337d881dc953631f6d808ad08774c1.tar.gz rails-9500ad5fbc337d881dc953631f6d808ad08774c1.tar.bz2 rails-9500ad5fbc337d881dc953631f6d808ad08774c1.zip |
Make sure count works on has_many :through associations using :group. Closes #10480 [remvee]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index cb17b6e483..a1c8bd6e50 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -55,6 +55,12 @@ module ActiveRecord end end + class HasManyThroughCantCountOnColumnForGroupedAssociation < ActiveRecordError #:nodoc: + def initialize(owner, reflection, column_name) + super("Cannot count on column '#{column_name}' for association '#{owner.class.name}##{reflection.name}' grouped by '#{reflection.options[:group]}'.") + end + end + class EagerLoadPolymorphicError < ActiveRecordError #:nodoc: def initialize(reflection) super("Can not eagerly load the polymorphic association #{reflection.name.inspect}") |