aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/project.rb
diff options
context:
space:
mode:
authormiloops <miloops@gmail.com>2008-11-21 19:20:33 -0300
committerMichael Koziarski <michael@koziarski.com>2008-12-01 20:22:31 +0100
commit97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859 (patch)
tree77998cf59255d49323d7f7063025ca895e162f62 /activerecord/test/models/project.rb
parent0c4ba90aa1ea6a8d386c724a55a31e63a13c46ab (diff)
downloadrails-97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859.tar.gz
rails-97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859.tar.bz2
rails-97403ad5fdfcdfb2110c6f8fd0ebf43b7afc4859.zip
Add :having option to find, to use in combination with grouped finds. Also added to has_many and has_and_belongs_to_many associations.
Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1028 state:committed]
Diffstat (limited to 'activerecord/test/models/project.rb')
-rw-r--r--activerecord/test/models/project.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/activerecord/test/models/project.rb b/activerecord/test/models/project.rb
index 44c692b5e7..550d4ae23c 100644
--- a/activerecord/test/models/project.rb
+++ b/activerecord/test/models/project.rb
@@ -13,6 +13,7 @@ class Project < ActiveRecord::Base
:after_add => Proc.new {|o, r| o.developers_log << "after_adding#{r.id || '<new>'}"},
:before_remove => Proc.new {|o, r| o.developers_log << "before_removing#{r.id}"},
:after_remove => Proc.new {|o, r| o.developers_log << "after_removing#{r.id}"}
+ has_and_belongs_to_many :well_payed_salary_groups, :class_name => "Developer", :group => "salary", :having => "SUM(salary) > 10000", :select => "SUM(salary) as salary"
attr_accessor :developers_log