aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures/developer.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2007-09-17 21:19:44 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2007-09-17 21:19:44 +0000
commit81d619ea0d7e936bdf5a643c8731e4b3f3746b8e (patch)
tree34aef34ef446db68d9122cde405c7e75bf771101 /activerecord/test/fixtures/developer.rb
parent6b1901da8f2db638884d3e51f84d4392775e7667 (diff)
downloadrails-81d619ea0d7e936bdf5a643c8731e4b3f3746b8e.tar.gz
rails-81d619ea0d7e936bdf5a643c8731e4b3f3746b8e.tar.bz2
rails-81d619ea0d7e936bdf5a643c8731e4b3f3746b8e.zip
Associations macros accept extension blocks alongside modules. Closes #9346.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7504 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures/developer.rb')
-rw-r--r--activerecord/test/fixtures/developer.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/developer.rb b/activerecord/test/fixtures/developer.rb
index 75fb307b19..c868cddecd 100644
--- a/activerecord/test/fixtures/developer.rb
+++ b/activerecord/test/fixtures/developer.rb
@@ -29,6 +29,16 @@ class Developer < ActiveRecord::Base
:association_foreign_key => "project_id",
:extend => [DeveloperProjectsAssociationExtension, DeveloperProjectsAssociationExtension2]
+ has_and_belongs_to_many :projects_extended_by_name_and_block,
+ :class_name => "Project",
+ :join_table => "developers_projects",
+ :association_foreign_key => "project_id",
+ :extend => DeveloperProjectsAssociationExtension do
+ def find_least_recent
+ find(:first, :order => "id ASC")
+ end
+ end
+
has_and_belongs_to_many :special_projects, :join_table => 'developers_projects', :association_foreign_key => 'project_id'
validates_inclusion_of :salary, :in => 50000..200000